From ad9a90926d109b828a8c337c247213db7e4fb26b Mon Sep 17 00:00:00 2001 From: Jonas 'Sortie' Termansen Date: Thu, 17 Oct 2013 13:05:29 +0200 Subject: [PATCH] Add O_NOFOLLOW. --- sortix/descriptor.cpp | 2 +- sortix/include/sortix/fcntl.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sortix/descriptor.cpp b/sortix/descriptor.cpp index da1825bb..4ad28b59 100644 --- a/sortix/descriptor.cpp +++ b/sortix/descriptor.cpp @@ -46,7 +46,7 @@ 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; +const int OPEN_FLAGS = O_CREATE | O_DIRECTORY | O_EXCL | O_TRUNC | O_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 209bd3b7..d631c4e0 100644 --- a/sortix/include/sortix/fcntl.h +++ b/sortix/include/sortix/fcntl.h @@ -43,7 +43,7 @@ __BEGIN_DECLS #define O_CLOFORK (1<<9) #define O_SEARCH (1<<10) #define O_NONBLOCK (1<<11) -// TODO: O_NOFOLLOW. +#define O_NOFOLLOW (1<<12) #define FD_CLOEXEC (1<<0) #define FD_CLOFORK (1<<1)