summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorjilles <jilles@FreeBSD.org>2016-06-09 22:14:58 +0000
committerjilles <jilles@FreeBSD.org>2016-06-09 22:14:58 +0000
commit563b27479d0b1c0ffa26232b3d397e3ef0124590 (patch)
tree8a65cd6c77bd6b3ec0d93048a55612c09f6fdad3 /lib
parent7e85cd3717a06b98f2acad2c3fc5fd8384a929ef (diff)
downloadFreeBSD-src-563b27479d0b1c0ffa26232b3d397e3ef0124590.zip
FreeBSD-src-563b27479d0b1c0ffa26232b3d397e3ef0124590.tar.gz
utimes(2),utime(3): Add deprecation in favour of utimensat(2) and futimens(2).
Setting time by seconds or microseconds may cause unexpected effects especially if sysctl vfs.timestamp_precision=3 (not default). Calling the obsolete functions with NULL timestamps is acceptable.
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/gen/utime.36
-rw-r--r--lib/libc/sys/utimes.217
2 files changed, 19 insertions, 4 deletions
diff --git a/lib/libc/gen/utime.3 b/lib/libc/gen/utime.3
index 1951613..20c7916 100644
--- a/lib/libc/gen/utime.3
+++ b/lib/libc/gen/utime.3
@@ -28,7 +28,7 @@
.\" @(#)utime.3 8.1 (Berkeley) 6/4/93
.\" $FreeBSD$
.\"
-.Dd June 4, 1993
+.Dd June 9, 2016
.Dt UTIME 3
.Os
.Sh NAME
@@ -43,7 +43,8 @@
.Sh DESCRIPTION
.Bf -symbolic
This interface is obsoleted by
-.Xr utimes 2 .
+.Xr utimensat 2
+because it is not accurate to fractions of a second.
.Ef
.Pp
The
@@ -79,6 +80,7 @@ for any of the errors specified for the library function
.Xr utimes 2 .
.Sh SEE ALSO
.Xr stat 2 ,
+.Xr utimensat 2 ,
.Xr utimes 2
.Sh STANDARDS
The
diff --git a/lib/libc/sys/utimes.2 b/lib/libc/sys/utimes.2
index 15db627..30d31d2 100644
--- a/lib/libc/sys/utimes.2
+++ b/lib/libc/sys/utimes.2
@@ -30,7 +30,7 @@
.\" @(#)utimes.2 8.1 (Berkeley) 6/4/93
.\" $FreeBSD$
.\"
-.Dd July 3, 2014
+.Dd June 9, 2016
.Dt UTIMES 2
.Os
.Sh NAME
@@ -52,6 +52,14 @@
.Ft int
.Fn futimesat "int fd" "const char *path" "const struct timeval times[2]"
.Sh DESCRIPTION
+.Bf -symbolic
+These interfaces are obsoleted by
+.Xr futimens 2
+and
+.Xr utimensat 2
+because they are not accurate to nanoseconds.
+.Ef
+.Pp
The access and modification times of the file named by
.Fa path
or referenced by
@@ -223,6 +231,7 @@ nor a file descriptor associated with a directory.
.Sh SEE ALSO
.Xr chflags 2 ,
.Xr stat 2 ,
+.Xr utimensat 2 ,
.Xr utime 3
.Sh STANDARDS
The
@@ -231,7 +240,11 @@ function is expected to conform to
.St -xpg4.2 .
The
.Fn futimesat
-system call follows The Open Group Extended API Set 2 specification.
+system call follows The Open Group Extended API Set 2 specification
+but was replaced by
+.Fn utimensat
+in
+.St -p1003.1-2008 .
.Sh HISTORY
The
.Fn utimes
OpenPOWER on IntegriCloud