diff options
author | Jim Meyering <jim@meyering.net> | 2005-11-22 14:53:47 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2005-11-22 14:53:47 +0000 |
commit | d591c302931fd774a643823c2c58788aca800f39 (patch) | |
tree | 1f3dbf2ac9a697b5e85e1217b46897a5ad6e804f | |
parent | 2fa54245e1a1200f7e25016ba1dcf8095f45b6ee (diff) | |
download | coreutils-d591c302931fd774a643823c2c58788aca800f39.tar.xz |
(openat_permissive): Declare.
(openat_ro): Define.
-rw-r--r-- | lib/openat.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/openat.h b/lib/openat.h index 4c2a2e0b7..c66645865 100644 --- a/lib/openat.h +++ b/lib/openat.h @@ -23,6 +23,7 @@ #include <sys/stat.h> #include <dirent.h> #include <unistd.h> +#include <stdbool.h> #ifndef __attribute__ # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) || __STRICT_ANSI__ @@ -46,6 +47,7 @@ # define __OPENAT_ID(y) __OPENAT_XCONCAT (__OPENAT_PREFIX, y) # define openat __OPENAT_ID (openat) int openat (int fd, char const *file, int flags, /* mode_t mode */ ...); +int openat_permissive (int fd, char const *file, int flags, bool *restore_failed, ...); # if ! HAVE_FDOPENDIR # define fdopendir __OPENAT_ID (fdopendir) # endif @@ -56,9 +58,14 @@ int fstatat (int fd, char const *file, struct stat *st, int flag); int unlinkat (int fd, char const *file, int flag); void openat_restore_fail (int) ATTRIBUTE_NORETURN; void openat_save_fail (int) ATTRIBUTE_NORETURN; +# define openat_ro(Fd, File, Flags, RF) openat_permissive (Fd, File, Flags, RF) # else # define openat_restore_fail(Errno) /* empty */ # define openat_save_fail(Errno) /* empty */ # endif #endif + +#ifndef openat_ro +# define openat_ro(Fd, File, Flags, RF) openat (Fd, File, Flags) +#endif |