内容简介
#include <unistd.h> int readlinkat(int dirfd, const char *path ", char *" buf ", size_t " bufsiz ) |
描述
The%uA0readlinkat() system call operates in exactly the same way as%uA0readlink(2), except for the differences described in this manual page.If the pathname given in%uA0path%uA0is relative, then it is interpreted relative to the directory referred to by the file descriptor%uA0dirfd%uA0(rather than relative to the current working directory of the calling process, as is done by%uA0readlink(2) for a relative pathname).
If the pathname given in%uA0path%uA0is relative and%uA0dirfd%uA0is the special value%uA0AT_FDCWD, thenpath%uA0is interpreted relative to the current working directory of the calling process (likereadlink(2)).
If the pathname given in%uA0path%uA0is absolute, then%uA0dirfd%uA0is ignored.
返回值
On success,%uA0readlinkat() returns 0. On error, -1 is returned and%uA0errno%uA0is set to indicate the error.错误
The same errors that occur for%uA0readlink(2) can also occur for%uA0readlinkat(). The following additional errors can occur for%uA0readlinkat():标签 | 描述 |
---|---|
EBADF | dirfd%uA0is not a valid file descriptor. |
ENOTDIR | |
%uA0 | path%uA0is a relative path and%uA0dirfd%uA0is a file descriptor referring to a file other than a directory. |