From dd1d7d1fa0c71ed0f084564f12c836406c46d30a Mon Sep 17 00:00:00 2001 From: Peter Wemm Date: Sat, 12 Jul 1997 11:16:18 +0000 Subject: [PATCH] Add a quick description of sysctlbyname() and link sysctl.3 to sysctlbyname.3 --- lib/libc/gen/Makefile.inc | 3 ++- lib/libc/gen/sysctl.3 | 12 +++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/lib/libc/gen/Makefile.inc b/lib/libc/gen/Makefile.inc index 59ffcbbcfc6..11e87c5563d 100644 --- a/lib/libc/gen/Makefile.inc +++ b/lib/libc/gen/Makefile.inc @@ -1,5 +1,5 @@ # @(#)Makefile.inc 8.6 (Berkeley) 5/4/95 -# $Id: Makefile.inc,v 1.35 1997/06/14 01:15:41 ache Exp $ +# $Id: Makefile.inc,v 1.36 1997/06/25 08:05:02 msmith Exp $ # machine-independent gen sources .PATH: ${.CURDIR}/../libc/${MACHINE}/gen ${.CURDIR}/../libc/gen @@ -114,6 +114,7 @@ MLINKS+=setmode.3 getmode.3 MLINKS+=sigsetops.3 sigemptyset.3 sigsetops.3 sigfillset.3 \ sigsetops.3 sigaddset.3 sigsetops.3 sigdelset.3 \ sigsetops.3 sigismember.3 +MLINKS+=sysctl.3 sysctlbyname.3 MLINKS+=syslog.3 closelog.3 syslog.3 openlog.3 syslog.3 setlogmask.3 \ syslog.3 vsyslog.3 MLINKS+=tcsendbreak.3 tcdrain.3 tcsendbreak.3 tcflush.3 tcsendbreak.3 tcflow.3 diff --git a/lib/libc/gen/sysctl.3 b/lib/libc/gen/sysctl.3 index df0b4c2e700..d1fe3b3d115 100644 --- a/lib/libc/gen/sysctl.3 +++ b/lib/libc/gen/sysctl.3 @@ -35,13 +35,15 @@ .Dt SYSCTL 3 .Os .Sh NAME -.Nm sysctl +.Nm sysctl , +.Nm sysctlbyname .Nd get or set system information .Sh SYNOPSIS .Fd #include .Fd #include .Ft int .Fn sysctl "int *name" "u_int namelen" "void *oldp" "size_t *oldlenp" "void *newp" "size_t newlen" +.Fn sysctlbyname "const char *name" "void *oldp" "size_t *oldlenp" "void *newp" "size_t newlen" .Sh DESCRIPTION The .Fn sysctl @@ -71,6 +73,14 @@ which is a .Fa namelen length array of integers. .Pp +The +.Fn sysctlbyname +function accepts an ascii representation of the name and internally +looks up the integer name vector. Apart from that, it behaves the same +as the standard +.Fn sysctl +function. +.Pp The information is copied into the buffer specified by .Fa oldp . The size of the buffer is given by the location specified by -- 2.45.2