termios.3: wfix
[man-pages.git] / man3 / futimes.3
blob713182dce2a7f454b9d5d8ac2138bcd25dfa45d0
1 .\" Copyright (c) 2006, 2008, 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 FUTIMES 3 2021-03-22 "Linux" "Linux Programmer's Manual"
26 .SH NAME
27 futimes, lutimes \- change file timestamps
28 .SH SYNOPSIS
29 .nf
30 .B #include <sys/time.h>
31 .PP
32 .BI "int futimes(int " fd ", const struct timeval " tv [2]);
33 .BI "int lutimes(const char *" filename ", const struct timeval " tv [2]);
34 .fi
35 .PP
36 .RS -4
37 Feature Test Macro Requirements for glibc (see
38 .BR feature_test_macros (7)):
39 .RE
40 .PP
41 .BR futimes (),
42 .BR lutimes ():
43 .nf
44     Since glibc 2.19:
45         _DEFAULT_SOURCE
46     Glibc 2.19 and earlier:
47         _BSD_SOURCE
48 .fi
49 .SH DESCRIPTION
50 .BR futimes ()
51 changes the access and modification times of a file in the same way as
52 .BR utimes (2),
53 with the difference that the file whose timestamps are to be changed
54 is specified via a file descriptor,
55 .IR fd ,
56 rather than via a pathname.
57 .PP
58 .BR lutimes ()
59 changes the access and modification times of a file in the same way as
60 .BR utimes (2),
61 with the difference that if
62 .I filename
63 refers to a symbolic link, then the link is not dereferenced:
64 instead, the timestamps of the symbolic link are changed.
65 .SH RETURN VALUE
66 On success, zero is returned.
67 On error, \-1 is returned, and
68 .I errno
69 is set to indicate the error.
70 .SH ERRORS
71 Errors are as for
72 .BR utimes (2),
73 with the following additions for
74 .BR futimes ():
75 .TP
76 .B EBADF
77 .I fd
78 is not a valid file descriptor.
79 .TP
80 .B ENOSYS
81 The
82 .I /proc
83 filesystem could not be accessed.
84 .PP
85 The following additional error may occur for
86 .BR lutimes ():
87 .TP
88 .B ENOSYS
89 The kernel does not support this call; Linux 2.6.22 or later is required.
90 .SH VERSIONS
91 .BR futimes ()
92 is available since glibc 2.3.
93 .BR lutimes ()
94 is available since glibc 2.6, and is implemented using the
95 .BR utimensat (2)
96 system call, which is supported since kernel 2.6.22.
97 .SH ATTRIBUTES
98 For an explanation of the terms used in this section, see
99 .BR attributes (7).
100 .ad l
103 allbox;
104 lbx lb lb
105 l l l.
106 Interface       Attribute       Value
108 .BR futimes (),
109 .BR lutimes ()
110 T}      Thread safety   MT-Safe
114 .sp 1
115 .SH CONFORMING TO
116 These functions are not specified in any standard.
117 Other than Linux, they are available only on the BSDs.
118 .SH SEE ALSO
119 .BR utime (2),
120 .BR utimensat (2),
121 .BR symlink (7)