1futimes(3)                 Library Functions Manual                 futimes(3)
2
3
4

NAME

6       futimes, lutimes - change file timestamps
7

LIBRARY

9       Standard C library (libc, -lc)
10

SYNOPSIS

12       #include <sys/time.h>
13
14       int futimes(int fd, const struct timeval tv[2]);
15       int lutimes(const char *filename, const struct timeval tv[2]);
16
17   Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
18
19       futimes(), lutimes():
20           Since glibc 2.19:
21               _DEFAULT_SOURCE
22           glibc 2.19 and earlier:
23               _BSD_SOURCE
24

DESCRIPTION

26       futimes()  changes  the  access and modification times of a file in the
27       same way as utimes(2), with the difference that the  file  whose  time‐
28       stamps are to be changed is specified via a file descriptor, fd, rather
29       than via a pathname.
30
31       lutimes() changes the access and modification times of a  file  in  the
32       same way as utimes(2), with the difference that if filename refers to a
33       symbolic link, then the link is not dereferenced:  instead,  the  time‐
34       stamps of the symbolic link are changed.
35

RETURN VALUE

37       On  success,  zero is returned.  On error, -1 is returned, and errno is
38       set to indicate the error.
39

ERRORS

41       Errors are as for utimes(2),  with  the  following  additions  for  fu‐
42       times():
43
44       EBADF  fd is not a valid file descriptor.
45
46       ENOSYS The /proc filesystem could not be accessed.
47
48       The following additional error may occur for lutimes():
49
50       ENOSYS The  kernel does not support this call; Linux 2.6.22 or later is
51              required.
52

ATTRIBUTES

54       For an  explanation  of  the  terms  used  in  this  section,  see  at‐
55       tributes(7).
56
57       ┌────────────────────────────────────────────┬───────────────┬─────────┐
58Interface                                   Attribute     Value   
59       ├────────────────────────────────────────────┼───────────────┼─────────┤
60futimes(), lutimes()                        │ Thread safety │ MT-Safe │
61       └────────────────────────────────────────────┴───────────────┴─────────┘
62

STANDARDS

64       Linux, BSD.
65

HISTORY

67       futimes()
68              glibc 2.3.
69
70       lutimes()
71              glibc 2.6.
72

NOTES

74       lutimes() is implemented using the utimensat(2) system call.
75

SEE ALSO

77       utime(2), utimensat(2), symlink(7)
78
79
80
81Linux man-pages 6.04              2023-03-30                        futimes(3)
Impressum