From 2311d634ac30451d5c39c55ac08eda0ea8401807 Mon Sep 17 00:00:00 2001 From: Jonas 'Sortie' Termansen Date: Sat, 16 Nov 2013 13:21:33 +0100 Subject: [PATCH] Add O_SYMLINK_NOFOLLOW. --- sortix/descriptor.cpp | 3 ++- sortix/include/sortix/fcntl.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/sortix/descriptor.cpp b/sortix/descriptor.cpp index 3e67c7ac..d5e9f958 100644 --- a/sortix/descriptor.cpp +++ b/sortix/descriptor.cpp @@ -51,7 +51,8 @@ namespace Sortix { const int ACCESS_FLAGS = O_READ | O_WRITE | O_EXEC | O_SEARCH; // Flags that only make sense at open time. -const int OPEN_FLAGS = O_CREATE | O_DIRECTORY | O_EXCL | O_TRUNC | O_NOFOLLOW; +const int OPEN_FLAGS = O_CREATE | O_DIRECTORY | O_EXCL | O_TRUNC | O_NOFOLLOW | + O_SYMLINK_NOFOLLOW; // Flags that only make sense for descriptors. const int DESCRIPTOR_FLAGS = O_APPEND | O_NONBLOCK; diff --git a/sortix/include/sortix/fcntl.h b/sortix/include/sortix/fcntl.h index 574624f1..011d8244 100644 --- a/sortix/include/sortix/fcntl.h +++ b/sortix/include/sortix/fcntl.h @@ -44,6 +44,7 @@ __BEGIN_DECLS #define O_SEARCH (1<<10) #define O_NONBLOCK (1<<11) #define O_NOFOLLOW (1<<12) +#define O_SYMLINK_NOFOLLOW (1<<13) #define FD_CLOEXEC (1<<0) #define FD_CLOFORK (1<<1)