svn commit: r294099 - stable/10/lib/libc/sys

Jilles Tjoelker jilles at FreeBSD.org
Fri Jan 15 20:55:46 UTC 2016


Author: jilles
Date: Fri Jan 15 20:55:44 2016
New Revision: 294099
URL: https://svnweb.freebsd.org/changeset/base/294099

Log:
  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.

Modified:
  stable/10/lib/libc/sys/futimens.c
  stable/10/lib/libc/sys/utimensat.2
  stable/10/lib/libc/sys/utimensat.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/lib/libc/sys/futimens.c
==============================================================================
--- stable/10/lib/libc/sys/futimens.c	Fri Jan 15 18:53:06 2016	(r294098)
+++ stable/10/lib/libc/sys/futimens.c	Fri Jan 15 20:55:44 2016	(r294099)
@@ -42,8 +42,11 @@ futimens(int fd, const struct timespec t
 {
 	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 &&

Modified: stable/10/lib/libc/sys/utimensat.2
==============================================================================
--- stable/10/lib/libc/sys/utimensat.2	Fri Jan 15 18:53:06 2016	(r294098)
+++ stable/10/lib/libc/sys/utimensat.2	Fri Jan 15 20:55:44 2016	(r294099)
@@ -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 .

Modified: stable/10/lib/libc/sys/utimensat.c
==============================================================================
--- stable/10/lib/libc/sys/utimensat.c	Fri Jan 15 18:53:06 2016	(r294098)
+++ stable/10/lib/libc/sys/utimensat.c	Fri Jan 15 20:55:44 2016	(r294099)
@@ -42,8 +42,11 @@ utimensat(int fd, const char *path, cons
 {
 	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) {


More information about the svn-src-all mailing list