unix: check faccessat flags parameter on Linux

Currently Linux faccessat(2) syscall implementation doesn't support the
flags parameter. As per discuss in golang/go#25845, permit the same flags
as glibc [1].

[1] https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/faccessat.c;h=ea42b2303ff4b2d2d6548ea04376fb265f773436;hb=HEAD

Fixes golang/go#25845

Change-Id: I390ba14b2816283399472f3572967b19d0a36042
Reviewed-on: https://go-review.googlesource.com/119495
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
Thanabodee Charoenpiriyakij
2018-06-20 13:35:08 +00:00
committed by Ian Lance Taylor
parent fc8bd948cf
commit ad87a3a340
25 changed files with 234 additions and 166 deletions
+6
View File
@@ -142,6 +142,10 @@ struct stat {
# define AT_STATX_DONT_SYNC 0x4000 // - Don't sync attributes with the server
#endif
#ifndef AT_EACCESS
# define AT_EACCESS 0x200 // Test access permitted for effective IDs, not real IDs.
#endif
#ifdef TCSETS2
// On systems that have "struct termios2" use this as type Termios.
typedef struct termios2 termios_t;
@@ -650,6 +654,8 @@ const (
AT_SYMLINK_FOLLOW = C.AT_SYMLINK_FOLLOW
AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW
AT_EACCESS = C.AT_EACCESS
)
type PollFd C.struct_pollfd