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