aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Kerrisk <mtk.manpages@gmail.com>2020-04-07 15:07:51 +0200
committerMichael Kerrisk <mtk.manpages@gmail.com>2020-04-10 10:14:29 +0200
commit3685736f10e82b57f8a19cfe13f8fc3f82ee23a7 (patch)
treebae78034fb37641edfde70e5bffeb98814b7ac9b
parentcf40643937f5dd9f8df515f5ce2997ea5fc07231 (diff)
downloadman-pages-3685736f10e82b57f8a19cfe13f8fc3f82ee23a7.tar.gz
time_namespaces.7: Add an ERRORS description for writes to timens_offsets
In particular, note the ERANGE restrictions reported by Thomas Gleixner. Reported-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
-rw-r--r--man7/time_namespaces.742
1 files changed, 41 insertions, 1 deletions
diff --git a/man7/time_namespaces.7 b/man7/time_namespaces.7
index 24b98c9722..656f365c90 100644
--- a/man7/time_namespaces.7
+++ b/man7/time_namespaces.7
@@ -106,7 +106,9 @@ These offsets are expressed relative to the clock values in
the initial time namespace.
The
.I offset-secs
-value can be negative.
+value can be negative, subject to restrictions noted below;
+.I offset-nanosecs
+is an unsigned value.
.PP
In the initial time namespace, the contents of the
.I timens_offsets
@@ -136,6 +138,44 @@ file, a process must have the
.BR CAP_SYS_TIME
capability in the user namespace that owns the time namespace.
.PP
+Writes to the
+.I timens_offsets
+file can fail with the following errors:
+.TP
+.B EINVAL
+An
+.I offset-nanosecs
+value is greater than 999,999,999.
+.TP
+.B EINVAL
+A
+.I clock-id
+value is not valid.
+.TP
+.B EPERM
+The caller does not have the
+the
+.BR CAP_SYS_TIME
+capability.
+.TP
+.B ERANGE
+An
+.I offset-secs
+value is out of range.
+In particular;
+.RS
+.IP \(bu 2
+.I offset-secs
+can't be set to a value which would make the current
+time on the corresponding clock inside the namespace a negative value; and
+.IP \(bu
+.I offset-secs
+can't be set to a value such that the time on the corresponding clock
+inside the namespace would exceed half of the value of the kernel constant
+.BR KTIME_SEC_MAX
+(this limits the clock value to a maximum of approximately 146 years).
+.RE
+.PP
In a new time namespace created by
.BR unshare (2),
the contents of the