futimes - 改变文件的一个相对的时间戳到一个目录文件描述符
内容简介
#include <fcntl.h>
int futimesat(int dirfd, const char *path, const struct timeval times[2]) |
描述
The%uA0futimesat() system call operates in exactly the same way as%uA0utimes(2), except for the differences described in this manual page.
If the pathname given in%uA0pathname%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%uA0utimes(2) for a relative pathname).
If the pathname given in%uA0pathname%uA0is relative and%uA0dirfd%uA0is the special value%uA0AT_FDCWD, then%uA0pathname%uA0is interpreted relative to the current working directory of the calling process (like%uA0utimes(2)).
If the pathname given in%uA0pathname%uA0is absolute, then%uA0dirfd%uA0is ignored.
返回值
On success,%uA0futimesat() returns a 0. On error, -1 is returned and%uA0errno%uA0is set to indicate the error.
错误
The same errors that occur for%uA0utimes(2) can also occur for%uA0futimesat(). The following additional errors can occur for%uA0futimesat():
标签 | 描述 |
---|---|
EBADF | dirfd%uA0is not a valid file descriptor. |
ENOTDIR | pathname%uA0is a relative path and%uA0dirfd%uA0is a file descriptor referring to a file other than a directory. |
遵循于
This system call is non-standard but is proposed for inclusion in a future revision of POSIX.1. A similar system call exists on Solaris.
GLIBC 注意
If the%uA0path%uA0argument is NULL, then the glibc%uA0futimes() wrapper function updates the times for the file referred to by%uA0dirfd.
版本
futimesat() was added to Linux in kernel 2.6.16.