seccomp_unotify.2: tfix
[man-pages.git] / man2 / futimesat.2
blob86e941fe59675247652cbbfb04c3029eef6d5f3b
1 .\" This manpage is Copyright (C) 2006, Michael Kerrisk
2 .\"
3 .\" %%%LICENSE_START(VERBATIM)
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
7 .\"
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
12 .\"
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein.  The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
19 .\" professionally.
20 .\"
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" %%%LICENSE_END
24 .\"
25 .TH FUTIMESAT 2 2017-09-15 "Linux" "Linux Programmer's Manual"
26 .SH NAME
27 futimesat \- change timestamps of a file relative to a \
28 directory file descriptor
29 .SH SYNOPSIS
30 .nf
31 .BR "#include <fcntl.h>" "            /* Definition of " AT_* " constants */"
32 .B #include <sys/time.h>
33 .PP
34 .BI "int futimesat(int " dirfd ", const char *" pathname ,
35 .BI "              const struct timeval " times [2]);
36 .fi
37 .PP
38 .RS -4
39 Feature Test Macro Requirements for glibc (see
40 .BR feature_test_macros (7)):
41 .RE
42 .PP
43 .BR futimesat ():
44 .nf
45     _GNU_SOURCE
46 .fi
47 .SH DESCRIPTION
48 This system call is obsolete.
49 Use
50 .BR utimensat (2)
51 instead.
52 .PP
53 The
54 .BR futimesat ()
55 system call operates in exactly the same way as
56 .BR utimes (2),
57 except for the differences described in this manual page.
58 .PP
59 If the pathname given in
60 .I pathname
61 is relative, then it is interpreted relative to the directory
62 referred to by the file descriptor
63 .I dirfd
64 (rather than relative to the current working directory of
65 the calling process, as is done by
66 .BR utimes (2)
67 for a relative pathname).
68 .PP
70 .I pathname
71 is relative and
72 .I dirfd
73 is the special value
74 .BR AT_FDCWD ,
75 then
76 .I pathname
77 is interpreted relative to the current working
78 directory of the calling process (like
79 .BR utimes (2)).
80 .PP
82 .I pathname
83 is absolute, then
84 .I dirfd
85 is ignored.
86 .SH RETURN VALUE
87 On success,
88 .BR futimesat ()
89 returns a 0.
90 On error, \-1 is returned and
91 .I errno
92 is set to indicate the error.
93 .SH ERRORS
94 The same errors that occur for
95 .BR utimes (2)
96 can also occur for
97 .BR futimesat ().
98 The following additional errors can occur for
99 .BR futimesat ():
101 .B EBADF
102 .I dirfd
103 is not a valid file descriptor.
105 .B ENOTDIR
106 .I pathname
107 is relative and
108 .I dirfd
109 is a file descriptor referring to a file other than a directory.
110 .SH VERSIONS
111 .BR futimesat ()
112 was added to Linux in kernel 2.6.16;
113 library support was added to glibc in version 2.4.
114 .SH CONFORMING TO
115 This system call is nonstandard.
116 It was implemented from a specification that was proposed for POSIX.1,
117 but that specification was replaced by the one for
118 .BR utimensat (2).
120 A similar system call exists on Solaris.
121 .SH NOTES
122 .SS Glibc notes
124 .I pathname
125 is NULL, then the glibc
126 .BR futimesat ()
127 wrapper function updates the times for the file referred to by
128 .IR dirfd .
129 .\" The Solaris futimesat() also has this strangeness.
130 .SH SEE ALSO
131 .BR stat (2),
132 .BR utimensat (2),
133 .BR utimes (2),
134 .BR futimes (3),
135 .BR path_resolution (7)