From 5c46041a9c8e0431f0b329a94becfc5d576d12cb Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Fri, 16 Dec 2005 00:24:16 +0000 Subject: * sysdeps/unix/sysv/linux/renameat.c: Move errno setting code in separate function __atfct_seterrno_2. * include/fcntl.h: Declare __atfct_seterrno_2. * posix/unistd.h: Declare linkat, symlinkat, readlinkat. * io/Makefile (routines): Add linkat, symlinkat, readlinkat. * io/Versions [GLIBC_2.4]: Export linkat, symlinkat, readlinkat. * io/linkat.c: New file. * io/readlinkat.c: New file. * io/symlinkat.c: New file. * sysdeps/unix/sysv/linux/linkat.c: New file. * sysdeps/unix/sysv/linux/readlinkat.c: New file. * sysdeps/unix/sysv/linux/symlinkat.c: New file. --- posix/unistd.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'posix') diff --git a/posix/unistd.h b/posix/unistd.h index 86e0e9e..9684126 100644 --- a/posix/unistd.h +++ b/posix/unistd.h @@ -742,6 +742,13 @@ extern int ttyslot (void) __THROW; extern int link (__const char *__from, __const char *__to) __THROW __nonnull ((1, 2)) __wur; +#ifdef __USE_GNU +/* Like link but relative paths in TO and FROM are interpreted relative + to FROMFD and TOFD respectively. */ +extern int linkat (int __fromfd, __const char *__from, int __tofd, + __const char *__to) __THROW __nonnull ((2, 4)) __wur; +#endif + #if defined __USE_BSD || defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K /* Make a symbolic link to FROM named TO. */ extern int symlink (__const char *__from, __const char *__to) @@ -754,6 +761,17 @@ extern int readlink (__const char *__restrict __path, char *__restrict __buf, size_t __len) __THROW __nonnull ((1, 2)) __wur; #endif /* Use BSD. */ +#ifdef __USE_GNU +/* Like symlink but a relative path in TO is interpreted relative to TOFD. */ +extern int symlinkat (__const char *__from, int __tofd, + __const char *__to) __THROW __nonnull ((1, 3)) __wur; + +/* Like readlink but a relative PATH is interpreted relative to FD. */ +extern int readlinkat (int __fd, __const char *__restrict __path, + char *__restrict __buf, size_t __len) + __THROW __nonnull ((2, 3)) __wur; +#endif + /* Remove the link NAME. */ extern int unlink (__const char *__name) __THROW __nonnull ((1)); -- cgit v1.1