From 7ae60af75b78f408420512c58fd5a08ca7a88bad Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Sat, 17 Sep 2022 19:47:57 +0000 Subject: 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. --- include/sys/stat.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/sys') diff --git a/include/sys/stat.h b/include/sys/stat.h index 13e777b..4a29e84 100644 --- a/include/sys/stat.h +++ b/include/sys/stat.h @@ -66,10 +66,12 @@ hidden_proto (__fstatat64_time64); extern int __chmod (const char *__file, __mode_t __mode); libc_hidden_proto (__chmod) extern int __fchmod (int __fd, __mode_t __mode); +extern int __fchmodat (int __fd, const char *__file, mode_t __mode, int __flag); libc_hidden_proto (fchmodat) extern __mode_t __umask (__mode_t __mask); extern int __mkdir (const char *__path, __mode_t __mode); libc_hidden_proto (__mkdir) +extern int __mkdirat (int __fd, const char *__path, mode_t __mode); extern int __mknodat (int fd, const char *path, mode_t mode, dev_t dev); libc_hidden_proto (__mknodat); -- cgit v1.1