diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2022-09-17 19:47:57 +0000 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2022-09-17 19:58:30 +0000 |
commit | 7ae60af75b78f408420512c58fd5a08ca7a88bad (patch) | |
tree | 51ef7f542c448a0717e69029f1b9dd164933c7bd /include/unistd.h | |
parent | 6841aed6c4abde1aa7015348496c86cadc227a1f (diff) | |
download | glibc-7ae60af75b78f408420512c58fd5a08ca7a88bad.tar.gz |
hurd: Factorize at/non-at functions
Non-at functions can be implemented by just calling the corresponding at
function with AT_FDCWD and zero at_flags.
In the linkat case, the at behavior is different (O_NOLINK), so this introduces
__linkat_common to pass O_NOLINK as appropriate.
lstat functions can also be implemented with fstatat by adding
__fstatat64_common which takes a flags parameter in addition to the at_flags
parameter,
In the end this factorizes chmod, chown, link, lstat64, mkdir, readlink,
rename, stat64, symlink, unlink, utimes.
This also makes __lstat, __lxstat64, __stat and __xstat64 directly use
__fstatat64_common instead of __lstat64 or __stat64.
Diffstat (limited to 'include/unistd.h')
-rw-r--r-- | include/unistd.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/unistd.h b/include/unistd.h index af795a37c8..4345d08d60 100644 --- a/include/unistd.h +++ b/include/unistd.h @@ -78,6 +78,7 @@ extern int __chown (const char *__file, libc_hidden_proto (__chown) extern int __fchown (int __fd, __uid_t __owner, __gid_t __group); +extern int __fchownat (int __fd, const char *__file, uid_t __owner, gid_t __group, int __flag); extern int __lchown (const char *__file, __uid_t __owner, __gid_t __group); extern int __chdir (const char *__path) attribute_hidden; @@ -148,9 +149,12 @@ libc_hidden_proto (_Fork); extern int __isatty (int __fd) attribute_hidden; extern int __link (const char *__from, const char *__to); extern int __symlink (const char *__from, const char *__to); +extern int __symlinkat (const char *__from, int __fd, const char *__to); extern ssize_t __readlink (const char *__path, char *__buf, size_t __len) attribute_hidden; +extern ssize_t __readlinkat (int __fd, const char *__file_name, char *__buf, size_t __len); extern int __unlink (const char *__name) attribute_hidden; +extern int __unlinkat (int __fd, const char *__name, int __flag); extern int __gethostname (char *__name, size_t __len) attribute_hidden; extern int __revoke (const char *__file); extern int __profil (unsigned short int *__sample_buffer, size_t __size, |