Add support for O_NOFOLLOW and O_DIRECT to Linux fcntl() F_GETFL/F_SETFL.

This commit is contained in:
Matthew N. Dodd 2005-04-13 04:31:43 +00:00
parent 71ba49aa94
commit 73c730a694
2 changed files with 21 additions and 0 deletions

View File

@ -979,6 +979,14 @@ fcntl_common(struct thread *td, struct linux_fcntl64_args *args)
td->td_retval[0] |= LINUX_O_SYNC;
if (result & O_ASYNC)
td->td_retval[0] |= LINUX_FASYNC;
#ifdef LINUX_O_NOFOLLOW
if (result & O_NOFOLLOW)
td->td_retval[0] |= LINUX_O_NOFOLLOW;
#endif
#ifdef LINUX_O_DIRECT
if (result & O_DIRECT)
td->td_retval[0] |= LINUX_O_DIRECT;
#endif
return (error);
case LINUX_F_SETFL:
@ -991,6 +999,14 @@ fcntl_common(struct thread *td, struct linux_fcntl64_args *args)
arg |= O_FSYNC;
if (args->arg & LINUX_FASYNC)
arg |= O_ASYNC;
#ifdef LINUX_O_NOFOLLOW
if (args->arg & LINUX_O_NOFOLLOW)
arg |= O_NOFOLLOW;
#endif
#ifdef LINUX_O_DIRECT
if (args->arg & LINUX_O_DIRECT)
arg |= O_DIRECT;
#endif
return (kern_fcntl(td, args->fd, F_SETFL, arg));
case LINUX_F_GETLK:

View File

@ -484,6 +484,11 @@ int linux_ioctl_unregister_handler(struct linux_ioctl_handler *h);
#define LINUX_O_NDELAY LINUX_O_NONBLOCK
#define LINUX_O_SYNC 010000
#define LINUX_FASYNC 020000
#define LINUX_O_DIRECT 040000 /* direct disk access hint */
#define LINUX_O_LARGEFILE 0100000
#define LINUX_O_DIRECTORY 0200000 /* must be a directory */
#define LINUX_O_NOFOLLOW 0400000 /* don't follow links */
#define LINUX_O_NOATIME 01000000
#define LINUX_F_DUPFD 0
#define LINUX_F_GETFD 1