Debian Codegraph @

upstream/debian-unstable/man3/futimes.3

raw
1 '\" t
2 .\" Copyright 2006-2008, Michael Kerrisk <[email protected]>
3 .\" Copyright, the authors of the Linux man-pages project
4 .\"
5 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
6 .\"
7 .TH futimes 3 2026-02-08 "Linux man-pages 6.18"
8 .SH NAME
9 futimes, lutimes \- change file timestamps
10 .SH LIBRARY
11 Standard C library
12 .RI ( libc ,\~ \-lc )
13 .SH SYNOPSIS
14 .nf
15 .B #include <sys/time.h>
16 .P
17 .BI "int futimes(int " fd ", const struct timeval " tv [2]);
18 .BI "int lutimes(const char *" path ", const struct timeval " tv [2]);
19 .fi
20 .P
21 .RS -4
22 Feature Test Macro Requirements for glibc (see
23 .BR feature_test_macros (7)):
24 .RE
25 .P
26 .BR futimes (),
27 .BR lutimes ():
28 .nf
29 Since glibc 2.19:
30 _DEFAULT_SOURCE
31 glibc 2.19 and earlier:
32 _BSD_SOURCE
33 .fi
34 .SH DESCRIPTION
35 .BR futimes ()
36 changes the access and modification times of a file in the same way as
37 .BR utimes (2),
38 with the difference that the file whose timestamps are to be changed
39 is specified via a file descriptor,
40 .IR fd ,
41 rather than via a pathname.
42 .P
43 .BR lutimes ()
44 changes the access and modification times of a file in the same way as
45 .BR utimes (2),
46 with the difference that if
47 .I path
48 refers to a symbolic link, then the link is not dereferenced:
49 instead, the timestamps of the symbolic link are changed.
50 .SH RETURN VALUE
51 On success, zero is returned.
52 On error, \-1 is returned, and
53 .I errno
54 is set to indicate the error.
55 .SH ERRORS
56 Errors are as for
57 .BR utimes (2),
58 with the following additions for
59 .BR futimes ():
60 .TP
61 .B EBADF
62 .I fd
63 is not a valid file descriptor.
64 .TP
65 .B ENOSYS
66 The
67 .I /proc
68 filesystem could not be accessed.
69 .P
70 The following additional error may occur for
71 .BR lutimes ():
72 .TP
73 .B ENOSYS
74 The kernel does not support this call;
75 Linux 2.6.22 or later is required.
76 .SH ATTRIBUTES
77 For an explanation of the terms used in this section, see
78 .BR attributes (7).
79 .TS
80 allbox;
81 lbx lb lb
82 l l l.
83 Interface Attribute Value
84 T{
85 .na
86 .nh
87 .BR futimes (),
88 .BR lutimes ()
89 T} Thread safety MT-Safe
90 .TE
91 .SH STANDARDS
92 Linux, BSD.
93 .SH HISTORY
94 .TP
95 .BR futimes ()
96 glibc 2.3.
97 .TP
98 .BR lutimes ()
99 glibc 2.6.
100 .SH NOTES
101 .BR lutimes ()
102 is implemented using the
103 .BR utimensat (2)
104 system call.
105 .SH SEE ALSO
106 .BR utime (2),
107 .BR utimensat (2),
108 .BR symlink (7)