diff options
Diffstat (limited to 'sysdeps/mach/hurd/access.c')
-rw-r--r-- | sysdeps/mach/hurd/access.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/sysdeps/mach/hurd/access.c b/sysdeps/mach/hurd/access.c index dc64183f96..31fd5bea56 100644 --- a/sysdeps/mach/hurd/access.c +++ b/sysdeps/mach/hurd/access.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-2016 Free Software Foundation, Inc. +/* Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -15,14 +15,24 @@ License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ +#include <errno.h> #include <unistd.h> #include <fcntl.h> +/* Test for access to FILE by our real user and group IDs without setting + errno. This may be unsafe to run during initialization of tunables + since access_common calls __hurd_file_name_lookup, which calls + __hurd_file_name_lookup_retry, which can set errno. */ +int +__access_noerrno (const char *file, int type) +{ + return __faccessat_noerrno (AT_FDCWD, file, type, 0); +} + /* Test for access to FILE by our real user and group IDs. */ int __access (const char *file, int type) { return __faccessat (AT_FDCWD, file, type, 0); } - weak_alias (__access, access) |