summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorcheloha <cheloha@cvs.openbsd.org>2019-01-18 05:03:43 +0000
committercheloha <cheloha@cvs.openbsd.org>2019-01-18 05:03:43 +0000
commit1018edf4e57ce0fab8eddf572afe4b57c448ba07 (patch)
tree413a8b9b4716d4eb1335f0e6f8caf221358156f3 /lib
parentb011b55cbe171077ef93b58bba86e01c19e9d52a (diff)
adjtime(2), settimeofday(2), clock_settime(2): validate input
Add documentation for the new EINVAL cases for adjtime(2) and settimeofday(2). adjtime.2 docs ok schwarze@, settimeofday(2)/clock_settime(2) stuff ok tedu@, "stop waiting" deraadt@
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/sys/adjtime.211
-rw-r--r--lib/libc/sys/gettimeofday.210
2 files changed, 15 insertions, 6 deletions
diff --git a/lib/libc/sys/adjtime.2 b/lib/libc/sys/adjtime.2
index ce638760c5b..91d0370025c 100644
--- a/lib/libc/sys/adjtime.2
+++ b/lib/libc/sys/adjtime.2
@@ -1,4 +1,4 @@
-.\" $OpenBSD: adjtime.2,v 1.22 2015/09/10 17:55:21 schwarze Exp $
+.\" $OpenBSD: adjtime.2,v 1.23 2019/01/18 05:03:42 cheloha Exp $
.\" $NetBSD: adjtime.2,v 1.5 1995/10/12 15:40:44 jtc Exp $
.\"
.\" Copyright (c) 1980, 1991, 1993
@@ -30,7 +30,7 @@
.\"
.\" @(#)adjtime.2 8.1 (Berkeley) 6/4/93
.\"
-.Dd $Mdocdate: September 10 2015 $
+.Dd $Mdocdate: January 18 2019 $
.Dt ADJTIME 2
.Os
.Sh NAME
@@ -87,9 +87,14 @@ will fail if:
.Bl -tag -width Er
.It Bq Er EFAULT
Either of the arguments point outside the process's allocated address space.
+.It Bq Er EINVAL
+The
+.Fa delta
+argument is non-null and specifies a microsecond value less than zero or
+greater than or equal to 1 million.
.It Bq Er EPERM
The
-.Fn delta
+.Fa delta
argument is non-null and the process's effective user ID is not that
of the superuser.
.El
diff --git a/lib/libc/sys/gettimeofday.2 b/lib/libc/sys/gettimeofday.2
index 81b27561e23..3f32e7b6fbf 100644
--- a/lib/libc/sys/gettimeofday.2
+++ b/lib/libc/sys/gettimeofday.2
@@ -1,4 +1,4 @@
-.\" $OpenBSD: gettimeofday.2,v 1.29 2015/09/10 17:55:21 schwarze Exp $
+.\" $OpenBSD: gettimeofday.2,v 1.30 2019/01/18 05:03:42 cheloha Exp $
.\"
.\" Copyright (c) 1980, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -29,7 +29,7 @@
.\"
.\" @(#)gettimeofday.2 8.2 (Berkeley) 5/26/95
.\"
-.Dd $Mdocdate: September 10 2015 $
+.Dd $Mdocdate: January 18 2019 $
.Dt GETTIMEOFDAY 2
.Os
.Sh NAME
@@ -118,8 +118,12 @@ An argument address referenced invalid memory.
.Pp
In addition,
.Fn settimeofday
-may return the following error:
+may return the following errors:
.Bl -tag -width Er
+.It Bq Er EINVAL
+.Fa tp
+specified a microsecond value less than zero or greater than or equal to
+1 million.
.It Bq Er EPERM
A user other than the superuser attempted to set the time.
.El