Debian Codegraph @

upstream/debian-trixie/man3/futimes.3

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