]>
Commit | Line | Data |
---|---|---|
4cc12725 | 1 | .\" Copyright (c) 2006, 2008, Michael Kerrisk |
9e1632fd | 2 | .\" |
93015253 | 3 | .\" %%%LICENSE_START(VERBATIM) |
9e1632fd MK |
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. | |
c13182ef | 12 | .\" |
9e1632fd MK |
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. | |
c13182ef | 20 | .\" |
9e1632fd MK |
21 | .\" Formatted or processed versions of this manual, if unaccompanied by |
22 | .\" the source, must acknowledge the copyright and authors of this work. | |
4b72fb64 | 23 | .\" %%%LICENSE_END |
9e1632fd | 24 | .\" |
4b8c67d9 | 25 | .TH FUTIMES 3 2017-09-15 "Linux" "Linux Programmer's Manual" |
9e1632fd | 26 | .SH NAME |
4cc12725 | 27 | futimes, lutimes \- change file timestamps |
9e1632fd MK |
28 | .SH SYNOPSIS |
29 | .nf | |
30 | .B #include <sys/time.h> | |
dbfe9c70 | 31 | .PP |
9e1632fd | 32 | .BI "int futimes(int " fd ", const struct timeval " tv [2]); |
dbfe9c70 | 33 | .PP |
be8dd9c8 | 34 | .BI "int lutimes(const char *" filename ", const struct timeval " tv [2]); |
9e1632fd | 35 | .fi |
68e4db0a | 36 | .PP |
cc4615cc MK |
37 | .in -4n |
38 | Feature Test Macro Requirements for glibc (see | |
39 | .BR feature_test_macros (7)): | |
40 | .in | |
68e4db0a | 41 | .PP |
4cc12725 MK |
42 | .BR futimes (), |
43 | .BR lutimes (): | |
51c612fb MK |
44 | Since glibc 2.19: |
45 | _DEFAULT_SOURCE | |
46 | Glibc 2.19 and earlier: | |
47 | _BSD_SOURCE | |
9e1632fd MK |
48 | .SH DESCRIPTION |
49 | .BR futimes () | |
50 | changes the access and modification times of a file in the same way as | |
51 | .BR utimes (2), | |
52 | with the difference that the file whose timestamps are to be changed | |
c13182ef | 53 | is specified via a file descriptor, |
9e1632fd MK |
54 | .IR fd , |
55 | rather than via a pathname. | |
847e0d88 | 56 | .PP |
4cc12725 MK |
57 | .BR lutimes () |
58 | changes the access and modification times of a file in the same way as | |
59 | .BR utimes (2), | |
60 | with the difference that if | |
61 | .I filename | |
62 | refers to a symbolic link, then the link is not dereferenced: | |
63 | instead, the timestamps of the symbolic link are changed. | |
47297adb | 64 | .SH RETURN VALUE |
c13182ef MK |
65 | On success, zero is returned. |
66 | On error, \-1 is returned, and | |
9e1632fd MK |
67 | .I errno |
68 | is set appropriately. | |
69 | .SH ERRORS | |
c13182ef | 70 | Errors are as for |
9e1632fd | 71 | .BR utimes (2), |
4cc12725 MK |
72 | with the following additions for |
73 | .BR futimes (): | |
9e1632fd MK |
74 | .TP |
75 | .B EBADF | |
76 | .I fd | |
77 | is not a valid file descriptor. | |
78 | .TP | |
79 | .B ENOSYS | |
80 | The | |
81 | .I /proc | |
9ee4a2b6 | 82 | filesystem could not be accessed. |
0f12d518 MK |
83 | .PP |
84 | The following additional error may occur for | |
85 | .BR lutimes (): | |
86 | .TP | |
87 | .B ENOSYS | |
88 | The kernel does not support this call; Linux 2.6.22 or later is required. | |
9e1632fd MK |
89 | .SH VERSIONS |
90 | .BR futimes () | |
91 | is available since glibc 2.3. | |
4cc12725 | 92 | .BR lutimes () |
c6e5efd8 MK |
93 | is available since glibc 2.6, and is implemented using the |
94 | .BR utimensat (2) | |
95 | system call, which is supported since kernel 2.6.22. | |
40b42b6f | 96 | .SH ATTRIBUTES |
8b1ef1c5 MK |
97 | For an explanation of the terms used in this section, see |
98 | .BR attributes (7). | |
99 | .TS | |
100 | allbox; | |
101 | lbw20 lb lb | |
102 | l l l. | |
103 | Interface Attribute Value | |
104 | T{ | |
105 | .BR futimes (), | |
40b42b6f | 106 | .BR lutimes () |
8b1ef1c5 MK |
107 | T} Thread safety MT-Safe |
108 | .TE | |
47297adb | 109 | .SH CONFORMING TO |
4cc12725 | 110 | These functions are not specified in any standard. |
33a0ccb2 | 111 | Other than Linux, they are available only on the BSDs. |
47297adb | 112 | .SH SEE ALSO |
a9cfde1d | 113 | .BR utime (2), |
3e5c319e | 114 | .BR utimensat (2), |
ad22ad55 | 115 | .BR symlink (7) |