OSDN Git Service

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