linux: implement O_PATH

Reviewed By:	kib
Sponsored By:	EPSRC
Differential Revision:	https://reviews.freebsd.org/D29773
This commit is contained in:
Edward Tomasz Napierala 2021-04-15 15:24:51 +01:00
parent 788a171c77
commit 1663120ae4
2 changed files with 3 additions and 0 deletions

View File

@ -162,6 +162,8 @@ linux_common_openflags(int l_flags)
bsd_flags |= O_NOFOLLOW; bsd_flags |= O_NOFOLLOW;
if (l_flags & LINUX_O_DIRECTORY) if (l_flags & LINUX_O_DIRECTORY)
bsd_flags |= O_DIRECTORY; bsd_flags |= O_DIRECTORY;
if (l_flags & LINUX_O_PATH)
bsd_flags |= O_PATH;
/* XXX LINUX_O_NOATIME: unable to be easily implemented. */ /* XXX LINUX_O_NOATIME: unable to be easily implemented. */
return (bsd_flags); return (bsd_flags);
} }

View File

@ -84,6 +84,7 @@
#define LINUX_O_NOFOLLOW 000400000 /* Do not follow links */ #define LINUX_O_NOFOLLOW 000400000 /* Do not follow links */
#define LINUX_O_NOATIME 001000000 #define LINUX_O_NOATIME 001000000
#define LINUX_O_CLOEXEC 002000000 #define LINUX_O_CLOEXEC 002000000
#define LINUX_O_PATH 010000000
#define LINUX_F_DUPFD 0 #define LINUX_F_DUPFD 0
#define LINUX_F_GETFD 1 #define LINUX_F_GETFD 1