diff options
author | jilles <jilles@FreeBSD.org> | 2016-01-15 20:55:44 +0000 |
---|---|---|
committer | jilles <jilles@FreeBSD.org> | 2016-01-15 20:55:44 +0000 |
commit | 53a08c47dc008c1a26310a622e72b42d0f88f791 (patch) | |
tree | 161b36e918d701361a5a8c431c46802731673c77 /lib/libc/sys | |
parent | ce58d6dbf38815b68dedcf0559779e5ceb149a0d (diff) | |
download | FreeBSD-src-53a08c47dc008c1a26310a622e72b42d0f88f791.zip FreeBSD-src-53a08c47dc008c1a26310a622e72b42d0f88f791.tar.gz |
MFC r293783: futimens/utimensat: Use the new system calls.
Update the __FreeBSD_version check in lib/libc/sys/futimens.c and
lib/libc/sys/utimensat.c. Before this, fallback code using
futimes/futimesat/lutimes was used except when running on a sufficiently
recent 11-current kernel.
Also, update the history section in the man page.
Diffstat (limited to 'lib/libc/sys')
-rw-r--r-- | lib/libc/sys/futimens.c | 5 | ||||
-rw-r--r-- | lib/libc/sys/utimensat.2 | 4 | ||||
-rw-r--r-- | lib/libc/sys/utimensat.c | 5 |
3 files changed, 10 insertions, 4 deletions
diff --git a/lib/libc/sys/futimens.c b/lib/libc/sys/futimens.c index 2014cc5..59fb37f 100644 --- a/lib/libc/sys/futimens.c +++ b/lib/libc/sys/futimens.c @@ -42,8 +42,11 @@ futimens(int fd, const struct timespec times[2]) { struct timeval now, tv[2], *tvp; struct stat sb; + int osreldate; - if (__getosreldate() >= 1100056) + osreldate = __getosreldate(); + if (osreldate >= 1100056 || + (osreldate >= 1002506 && osreldate < 1100000)) return (__sys_futimens(fd, times)); if (times == NULL || (times[0].tv_nsec == UTIME_NOW && diff --git a/lib/libc/sys/utimensat.2 b/lib/libc/sys/utimensat.2 index 0f397c6..57ad904 100644 --- a/lib/libc/sys/utimensat.2 +++ b/lib/libc/sys/utimensat.2 @@ -31,7 +31,7 @@ .\" @(#)utimes.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd January 23, 2015 +.Dd January 12, 2016 .Dt UTIMENSAT 2 .Os .Sh NAME @@ -289,4 +289,4 @@ The and .Fn utimensat system calls appeared in -.Fx 11.0 . +.Fx 10.3 . diff --git a/lib/libc/sys/utimensat.c b/lib/libc/sys/utimensat.c index 67d19cb..a1c3c21 100644 --- a/lib/libc/sys/utimensat.c +++ b/lib/libc/sys/utimensat.c @@ -42,8 +42,11 @@ utimensat(int fd, const char *path, const struct timespec times[2], int flag) { struct timeval now, tv[2], *tvp; struct stat sb; + int osreldate; - if (__getosreldate() >= 1100056) + osreldate = __getosreldate(); + if (osreldate >= 1100056 || + (osreldate >= 1002506 && osreldate < 1100000)) return (__sys_utimensat(fd, path, times, flag)); if ((flag & ~AT_SYMLINK_NOFOLLOW) != 0) { |