OSDN Git Service

597b47b4f3a87b28ed221a8201fbb081d949a45c
[linuxjm/LDP_man-pages.git] / original / man3 / futimes.3
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 2013-10-29 "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
32 .BI "int futimes(int " fd ", const struct timeval " tv [2]);
33
34 .BI "int lutimes(const char *" filename ", const struct timeval " tv [2]);
35 .fi
36 .sp
37 .in -4n
38 Feature Test Macro Requirements for glibc (see
39 .BR feature_test_macros (7)):
40 .in
41 .sp
42 .BR futimes (),
43 .BR lutimes ():
44 _BSD_SOURCE
45 .SH DESCRIPTION
46 .BR futimes ()
47 changes the access and modification times of a file in the same way as
48 .BR utimes (2),
49 with the difference that the file whose timestamps are to be changed
50 is specified via a file descriptor,
51 .IR fd ,
52 rather than via a pathname.
53
54 .BR lutimes ()
55 changes the access and modification times of a file in the same way as
56 .BR utimes (2),
57 with the difference that if
58 .I filename
59 refers to a symbolic link, then the link is not dereferenced:
60 instead, the timestamps of the symbolic link are changed.
61 .SH RETURN VALUE
62 On success, zero is returned.
63 On error, \-1 is returned, and
64 .I errno
65 is set appropriately.
66 .SH ERRORS
67 Errors are as for
68 .BR utimes (2),
69 with the following additions for
70 .BR futimes ():
71 .TP
72 .B EBADF
73 .I fd
74 is not a valid file descriptor.
75 .TP
76 .B ENOSYS
77 The
78 .I /proc
79 filesystem could not be accessed.
80 .PP
81 The following additional error may occur for
82 .BR lutimes ():
83 .TP
84 .B ENOSYS
85 The kernel does not support this call; Linux 2.6.22 or later is required.
86 .SH VERSIONS
87 .BR futimes ()
88 is available since glibc 2.3.
89 .BR lutimes ()
90 is available since glibc 2.6, and is implemented using the
91 .BR utimensat (2)
92 system call, which is supported since kernel 2.6.22.
93 .SH ATTRIBUTES
94 .SS Multithreading (see pthreads(7))
95 The
96 .BR futimes ()
97 and
98 .BR lutimes ()
99 functions are thread-safe.
100 .SH CONFORMING TO
101 These functions are not specified in any standard.
102 Other than Linux, they are available only on the BSDs.
103 .SH SEE ALSO
104 .BR utime (2),
105 .BR utimensat (2),
106 .BR symlink (7)
107 .SH COLOPHON
108 This page is part of release 3.67 of the Linux
109 .I man-pages
110 project.
111 A description of the project,
112 information about reporting bugs,
113 and the latest version of this page,
114 can be found at
115 \%http://www.kernel.org/doc/man\-pages/.