Mercurial > hg > octave-shane > gnulib-hg
annotate lib/utimens.h @ 12193:d1ea4269ac6f
fdutimensat: new module
Needed for coreutils copy.c to be rewritten to use fts.
* modules/fdutimensat: New file.
* lib/fdutimensat.c (fdutimensat): Likewise.
* lib/utimens.h (fdutimensat, lutimensat): Declare new functions.
* MODULES.html.sh (File system functions): Mention module.
* modules/fdutimensat-tests: New test.
* tests/test-fdutimensat.c: Likewise.
Signed-off-by: Eric Blake <ebb9@byu.net>
author | Eric Blake <ebb9@byu.net> |
---|---|
date | Tue, 20 Oct 2009 06:09:29 -0600 |
parents | c4a167621772 |
children | f7caccc03505 |
rev | line source |
---|---|
8223
ca249819379f
* lib/getdate.h (includes): Include <time.h>, not "timespec.h".
Eric Blake <ebb9@byu.net>
parents:
5486
diff
changeset
|
1 #include <time.h> |
12161 | 2 int fdutimens (char const *, int, struct timespec const [2]); |
8859
6d52d75c164e
(gl_futimens): Rename from futimens, now that glibc-2.6 declares futimens.
Jim Meyering <jim@meyering.net>
parents:
8223
diff
changeset
|
3 int gl_futimens (int, char const *, struct timespec const [2]); |
5147 | 4 int utimens (char const *, struct timespec const [2]); |
12158 | 5 int lutimens (char const *, struct timespec const [2]); |
12193 | 6 |
7 #if GNULIB_FDUTIMENSAT | |
8 # include <fcntl.h> | |
9 # include <sys/stat.h> | |
10 | |
11 int fdutimensat (int dir, char const *name, int fd, struct timespec const [2]); | |
12 | |
13 /* Using this function makes application code slightly more readable. */ | |
14 static inline int | |
15 lutimensat (int fd, char const *file, struct timespec const times[2]) | |
16 { | |
17 return utimensat (fd, file, times, AT_SYMLINK_NOFOLLOW); | |
18 } | |
19 #endif |