summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Mooney <pmooney@pfmooney.com>2022-09-19 14:36:50 +0000
committerPatrick Mooney <pmooney@oxide.computer>2022-10-03 17:05:12 +0000
commitb93865c3d90e9b0d73e338c9abb3293c35c571a8 (patch)
tree87af203ef747dddd6d4bd431fcdbd6f024a5f4f8
parent3f6fd99d844f7d4b62e4e1ddb0c29a4c2f7eca15 (diff)
downloadillumos-joyent-b93865c3d90e9b0d73e338c9abb3293c35c571a8.tar.gz
14985 adjtime could be more const
Reviewed by: Robert Mustacchi <rm@fingolfin.org> Approved by: Dan McDonald <danmcd@mnx.io>
-rw-r--r--usr/src/lib/libc/common/sys/adjtime.s2
-rw-r--r--usr/src/man/man2/adjtime.213
-rw-r--r--usr/src/uts/common/os/sysent.c2
-rw-r--r--usr/src/uts/common/sys/time.h2
-rw-r--r--usr/src/uts/common/syscall/adjtime.c4
5 files changed, 6 insertions, 17 deletions
diff --git a/usr/src/lib/libc/common/sys/adjtime.s b/usr/src/lib/libc/common/sys/adjtime.s
index a860d6738d..be16f641aa 100644
--- a/usr/src/lib/libc/common/sys/adjtime.s
+++ b/usr/src/lib/libc/common/sys/adjtime.s
@@ -30,7 +30,7 @@
.file "adjtime.s"
/* C Library -- adjtime */
-/* int adjtime(struct timeval *delta, struct timeval *olddelta) */
+/* int adjtime(const struct timeval *delta, struct timeval *olddelta) */
#include "SYS.h"
diff --git a/usr/src/man/man2/adjtime.2 b/usr/src/man/man2/adjtime.2
index 93b0e4ac22..b4586b358a 100644
--- a/usr/src/man/man2/adjtime.2
+++ b/usr/src/man/man2/adjtime.2
@@ -1,19 +1,16 @@
'\" te
.\" Copyright 1989 AT&T Copyright (c) 1980 Regents of the University of California. All rights reserved. The Berkeley software License Agreement specifies the terms and conditions for redistribution. Copyright (c) 2003, Sun Microsystems, Inc. All Rights Reserved
-.TH ADJTIME 2 "Jan 20, 2003"
+.TH ADJTIME 2 "Sep 19, 2022"
.SH NAME
adjtime \- correct the time to allow synchronization of the system clock
.SH SYNOPSIS
-.LP
.nf
#include <sys/time.h>
-\fBint\fR \fBadjtime\fR(\fBstruct timeval *\fR\fIdelta\fR, \fBstruct timeval *\fR\fIolddelta\fR);
+\fBint\fR \fBadjtime\fR(\fBconst struct timeval *\fR\fIdelta\fR, \fBstruct timeval *\fR\fIolddelta\fR);
.fi
.SH DESCRIPTION
-.sp
-.LP
The \fBadjtime()\fR function adjusts the system's notion of the current time as
returned by \fBgettimeofday\fR(3C), advancing or retarding it by the amount of
time specified in the \fBstruct\fR \fBtimeval\fR pointed to by \fIdelta\fR.
@@ -47,13 +44,9 @@ Only a processes with appropriate privileges can adjust the time of day.
The adjustment value will be silently rounded to the resolution of the system
clock.
.SH RETURN VALUES
-.sp
-.LP
Upon successful completion, \fBadjtime()\fR returns \fB0\fR. Otherwise, it
returns \fB\(mi1\fR and sets \fBerrno\fR to indicate the error.
.SH ERRORS
-.sp
-.LP
The \fBadjtime()\fR function will fail if:
.sp
.ne 2
@@ -100,8 +93,6 @@ by \fIolddelta\fR is too small to contain the correct number of seconds.
.RE
.SH SEE ALSO
-.sp
-.LP
.BR date (1),
.BR gettimeofday (3C),
.BR privileges (7)
diff --git a/usr/src/uts/common/os/sysent.c b/usr/src/uts/common/os/sysent.c
index e87e6d8d29..ab12de3935 100644
--- a/usr/src/uts/common/os/sysent.c
+++ b/usr/src/uts/common/os/sysent.c
@@ -206,7 +206,7 @@ int getpmsg(int, struct strbuf *, struct strbuf *, int *, int *);
int putpmsg(int, struct strbuf *, struct strbuf *, int, int);
int memcntl(caddr_t, size_t, int, caddr_t, int, int);
long sysconfig(int);
-int adjtime(struct timeval *, struct timeval *);
+int adjtime(const struct timeval *, struct timeval *);
long systeminfo(int, char *, long);
int setegid(gid_t);
int seteuid(uid_t);
diff --git a/usr/src/uts/common/sys/time.h b/usr/src/uts/common/sys/time.h
index 8ec74d4ecd..634d5fb3a6 100644
--- a/usr/src/uts/common/sys/time.h
+++ b/usr/src/uts/common/sys/time.h
@@ -388,7 +388,7 @@ extern void hrt2ts32(hrtime_t, timestruc32_t *);
#endif /* _KERNEL */
#if !defined(_KERNEL) && !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
-int adjtime(struct timeval *, struct timeval *);
+int adjtime(const struct timeval *, struct timeval *);
#endif /* !defined(_KERNEL) && !defined(__XOPEN_OR_POSIX) ... */
#if !defined(_KERNEL) && !defined(__XOPEN_OR_POSIX) || \
diff --git a/usr/src/uts/common/syscall/adjtime.c b/usr/src/uts/common/syscall/adjtime.c
index dc2dde5306..5093e2d632 100644
--- a/usr/src/uts/common/syscall/adjtime.c
+++ b/usr/src/uts/common/syscall/adjtime.c
@@ -28,8 +28,6 @@
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI" /* from SVr4.0 1.78 */
-
#include <sys/param.h>
#include <sys/types.h>
#include <sys/sysmacros.h>
@@ -43,7 +41,7 @@
#include <sys/policy.h>
int
-adjtime(struct timeval *delta, struct timeval *olddelta)
+adjtime(const struct timeval *delta, struct timeval *olddelta)
{
struct timeval atv, oatv;
int64_t ndelta;