]>
Commit | Line | Data |
---|---|---|
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 | 7 | futimesat \- change timestamps of a file relative to a \ |
60652159 | 8 | directory file descriptor |
752e4edc AC |
9 | .SH LIBRARY |
10 | Standard 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 |
22 | Feature 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 |
31 | This system call is obsolete. |
32 | Use | |
33 | .BR utimensat (2) | |
34 | instead. | |
efeece04 | 35 | .PP |
60652159 MK |
36 | The |
37 | .BR futimesat () | |
38 | system call operates in exactly the same way as | |
39 | .BR utimes (2), | |
40 | except for the differences described in this manual page. | |
efeece04 | 41 | .PP |
c13182ef | 42 | If the pathname given in |
60652159 MK |
43 | .I pathname |
44 | is relative, then it is interpreted relative to the directory | |
45 | referred to by the file descriptor | |
0daa9e92 | 46 | .I dirfd |
c13182ef | 47 | (rather than relative to the current working directory of |
60652159 MK |
48 | the calling process, as is done by |
49 | .BR utimes (2) | |
50 | for a relative pathname). | |
efeece04 | 51 | .PP |
1343b604 | 52 | If |
60652159 | 53 | .I pathname |
c13182ef | 54 | is relative and |
60652159 MK |
55 | .I dirfd |
56 | is the special value | |
57 | .BR AT_FDCWD , | |
58 | then | |
59 | .I pathname | |
c13182ef | 60 | is interpreted relative to the current working |
60652159 MK |
61 | directory of the calling process (like |
62 | .BR utimes (2)). | |
efeece04 | 63 | .PP |
1343b604 | 64 | If |
0daa9e92 | 65 | .I pathname |
c13182ef MK |
66 | is absolute, then |
67 | .I dirfd | |
60652159 | 68 | is ignored. |
717c3a7d MK |
69 | (See |
70 | .BR openat (2) | |
71 | for an explanation of why the | |
72 | .I dirfd | |
73 | argument is useful.) | |
47297adb | 74 | .SH RETURN VALUE |
60652159 | 75 | On success, |
c13182ef | 76 | .BR futimesat () |
60652159 MK |
77 | returns a 0. |
78 | On error, \-1 is returned and | |
79 | .I errno | |
80 | is set to indicate the error. | |
81 | .SH ERRORS | |
82 | The same errors that occur for | |
83 | .BR utimes (2) | |
84 | can also occur for | |
85 | .BR futimesat (). | |
c13182ef | 86 | The following additional errors can occur for |
60652159 MK |
87 | .BR futimesat (): |
88 | .TP | |
89 | .B EBADF | |
9f4e736a MK |
90 | .I pathname |
91 | is relative but | |
60652159 | 92 | .I dirfd |
9f4e736a MK |
93 | is neither |
94 | .B AT_FDCWD | |
95 | nor a valid file descriptor. | |
60652159 MK |
96 | .TP |
97 | .B ENOTDIR | |
98 | .I pathname | |
b328773d | 99 | is relative and |
60652159 MK |
100 | .I dirfd |
101 | is a file descriptor referring to a file other than a directory. | |
a1d5f77c MK |
102 | .SH VERSIONS |
103 | .BR futimesat () | |
c95b6ae1 MK |
104 | was added to Linux in kernel 2.6.16; |
105 | library support was added to glibc in version 2.4. | |
3113c7f3 | 106 | .SH STANDARDS |
c8f2dd47 | 107 | This system call is nonstandard. |
7c40de08 | 108 | It was implemented from a specification that was proposed for POSIX.1, |
25fddfcd | 109 | but that specification was replaced by the one for |
41325efd | 110 | .BR utimensat (2). |
efeece04 | 111 | .PP |
60652159 | 112 | A similar system call exists on Solaris. |
d597239c | 113 | .SH NOTES |
c634028a | 114 | .SS Glibc notes |
1343b604 MK |
115 | If |
116 | .I pathname | |
c13182ef | 117 | is NULL, then the glibc |
0bfa087b | 118 | .BR futimesat () |
60652159 MK |
119 | wrapper 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) |