]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man2/futimesat.2
All pages: Remove the 5th argument to .TH
[thirdparty/man-pages.git] / man2 / futimesat.2
CommitLineData
60652159
MK
1.\" This manpage is Copyright (C) 2006, Michael Kerrisk
2.\"
5fbde956 3.\" SPDX-License-Identifier: Linux-man-pages-copyleft
60652159 4.\"
45186a5d 5.TH FUTIMESAT 2 2021-08-27 "Linux man-pages (unreleased)"
60652159 6.SH NAME
0bfa087b 7futimesat \- change timestamps of a file relative to a \
60652159 8directory file descriptor
752e4edc
AC
9.SH LIBRARY
10Standard C library
8fc3b2cf 11.RI ( libc ", " \-lc )
60652159
MK
12.SH SYNOPSIS
13.nf
c0e1178b 14.BR "#include <fcntl.h>" " /* Definition of " AT_* " constants */"
ba78c947 15.B #include <sys/time.h>
68e4db0a 16.PP
c13182ef 17.BI "int futimesat(int " dirfd ", const char *" pathname ,
60652159
MK
18.BI " const struct timeval " times [2]);
19.fi
68e4db0a 20.PP
d39ad78f 21.RS -4
7cc796ee
MK
22Feature Test Macro Requirements for glibc (see
23.BR feature_test_macros (7)):
d39ad78f 24.RE
68e4db0a 25.PP
7cc796ee 26.BR futimesat ():
1dd0d7b4
MK
27.nf
28 _GNU_SOURCE
29.fi
60652159 30.SH DESCRIPTION
25fddfcd
MK
31This system call is obsolete.
32Use
33.BR utimensat (2)
34instead.
efeece04 35.PP
60652159
MK
36The
37.BR futimesat ()
38system call operates in exactly the same way as
39.BR utimes (2),
40except for the differences described in this manual page.
efeece04 41.PP
c13182ef 42If the pathname given in
60652159
MK
43.I pathname
44is relative, then it is interpreted relative to the directory
45referred to by the file descriptor
0daa9e92 46.I dirfd
c13182ef 47(rather than relative to the current working directory of
60652159
MK
48the calling process, as is done by
49.BR utimes (2)
50for a relative pathname).
efeece04 51.PP
1343b604 52If
60652159 53.I pathname
c13182ef 54is relative and
60652159
MK
55.I dirfd
56is the special value
57.BR AT_FDCWD ,
58then
59.I pathname
c13182ef 60is interpreted relative to the current working
60652159
MK
61directory of the calling process (like
62.BR utimes (2)).
efeece04 63.PP
1343b604 64If
0daa9e92 65.I pathname
c13182ef
MK
66is absolute, then
67.I dirfd
60652159 68is ignored.
717c3a7d
MK
69(See
70.BR openat (2)
71for an explanation of why the
72.I dirfd
73argument is useful.)
47297adb 74.SH RETURN VALUE
60652159 75On success,
c13182ef 76.BR futimesat ()
60652159
MK
77returns a 0.
78On error, \-1 is returned and
79.I errno
80is set to indicate the error.
81.SH ERRORS
82The same errors that occur for
83.BR utimes (2)
84can also occur for
85.BR futimesat ().
c13182ef 86The following additional errors can occur for
60652159
MK
87.BR futimesat ():
88.TP
89.B EBADF
9f4e736a
MK
90.I pathname
91is relative but
60652159 92.I dirfd
9f4e736a
MK
93is neither
94.B AT_FDCWD
95nor a valid file descriptor.
60652159
MK
96.TP
97.B ENOTDIR
98.I pathname
b328773d 99is relative and
60652159
MK
100.I dirfd
101is a file descriptor referring to a file other than a directory.
a1d5f77c
MK
102.SH VERSIONS
103.BR futimesat ()
c95b6ae1
MK
104was added to Linux in kernel 2.6.16;
105library support was added to glibc in version 2.4.
3113c7f3 106.SH STANDARDS
c8f2dd47 107This system call is nonstandard.
7c40de08 108It was implemented from a specification that was proposed for POSIX.1,
25fddfcd 109but that specification was replaced by the one for
41325efd 110.BR utimensat (2).
efeece04 111.PP
60652159 112A similar system call exists on Solaris.
d597239c 113.SH NOTES
c634028a 114.SS Glibc notes
1343b604
MK
115If
116.I pathname
c13182ef 117is NULL, then the glibc
0bfa087b 118.BR futimesat ()
60652159
MK
119wrapper function updates the times for the file referred to by
120.IR dirfd .
121.\" The Solaris futimesat() also has this strangeness.
47297adb 122.SH SEE ALSO
60652159 123.BR stat (2),
25fddfcd 124.BR utimensat (2),
60652159 125.BR utimes (2),
19f6943d 126.BR futimes (3),
ad7cc990 127.BR path_resolution (7)