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. --- sysdeps/mach/hurd/readlinkat.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sysdeps/mach/hurd/readlinkat.c') diff --git a/sysdeps/mach/hurd/readlinkat.c b/sysdeps/mach/hurd/readlinkat.c index 278a0b5b00..b5e7781bd5 100644 --- a/sysdeps/mach/hurd/readlinkat.c +++ b/sysdeps/mach/hurd/readlinkat.c @@ -26,7 +26,7 @@ than LEN bytes of BUF. The contents are not null-terminated. Returns the number of characters read, or -1 for errors. */ ssize_t -readlinkat (int fd, const char *file_name, char *buf, size_t len) +__readlinkat (int fd, const char *file_name, char *buf, size_t len) { error_t err; file_t file_stat; @@ -67,4 +67,5 @@ readlinkat (int fd, const char *file_name, char *buf, size_t len) return err ? __hurd_fail (err) : len; } +weak_alias (__readlinkat, readlinkat) libc_hidden_def (readlinkat) -- cgit 1.4.1