summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen/sysctl.3
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2010-02-21 13:57:02 +0000
committered <ed@FreeBSD.org>2010-02-21 13:57:02 +0000
commit1fdea921e1450bf99dc432803cd6c88e08540a21 (patch)
treefcb4fe1d12f11b6cab916731649d8e0d8c2645b0 /lib/libc/gen/sysctl.3
parent24f8e6df2531b9453d13e5fc72bb019b22e630a8 (diff)
downloadFreeBSD-src-1fdea921e1450bf99dc432803cd6c88e08540a21.zip
FreeBSD-src-1fdea921e1450bf99dc432803cd6c88e08540a21.tar.gz
Add proper const keywords to sysctl(3) parameters.
The `name' and `newp' arguments can be marked const, because the buffers they refer to are never changed. While there, perform some other cleanups: - Remove K&R from sysctl.c. - Implement sysctlbyname() using sysctlnametomib() to prevent duplication of an undocumented kernel interface. - Fix some whitespace nits. It seems the prototypes are now in sync with NetBSD as well.
Diffstat (limited to 'lib/libc/gen/sysctl.3')
-rw-r--r--lib/libc/gen/sysctl.36
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libc/gen/sysctl.3 b/lib/libc/gen/sysctl.3
index 75f8668..143be16 100644
--- a/lib/libc/gen/sysctl.3
+++ b/lib/libc/gen/sysctl.3
@@ -28,7 +28,7 @@
.\" @(#)sysctl.3 8.4 (Berkeley) 5/9/95
.\" $FreeBSD$
.\"
-.Dd January 28, 2009
+.Dd February 21, 2010
.Dt SYSCTL 3
.Os
.Sh NAME
@@ -42,9 +42,9 @@
.In sys/types.h
.In sys/sysctl.h
.Ft int
-.Fn sysctl "int *name" "u_int namelen" "void *oldp" "size_t *oldlenp" "void *newp" "size_t newlen"
+.Fn sysctl "const int *name" "u_int namelen" "void *oldp" "size_t *oldlenp" "const void *newp" "size_t newlen"
.Ft int
-.Fn sysctlbyname "const char *name" "void *oldp" "size_t *oldlenp" "void *newp" "size_t newlen"
+.Fn sysctlbyname "const char *name" "void *oldp" "size_t *oldlenp" "const void *newp" "size_t newlen"
.Ft int
.Fn sysctlnametomib "const char *name" "int *mibp" "size_t *sizep"
.Sh DESCRIPTION
OpenPOWER on IntegriCloud