summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen/sysctlbyname.c
diff options
context:
space:
mode:
authorcvs2svn <cvs2svn@FreeBSD.org>1998-01-10 23:00:07 +0000
committercvs2svn <cvs2svn@FreeBSD.org>1998-01-10 23:00:07 +0000
commit7c6e96080c4fb49bf912942804477d202a53396c (patch)
tree876b1afcb203be407dbb2ddfc69653f78b8680c2 /lib/libc/gen/sysctlbyname.c
parent1a06f650e6ca43e02260e8d252597fbed2cea73e (diff)
downloadFreeBSD-src-7c6e96080c4fb49bf912942804477d202a53396c.zip
FreeBSD-src-7c6e96080c4fb49bf912942804477d202a53396c.tar.gz
This commit was manufactured by cvs2svn to create branch 'JB'.
Diffstat (limited to 'lib/libc/gen/sysctlbyname.c')
-rw-r--r--lib/libc/gen/sysctlbyname.c35
1 files changed, 0 insertions, 35 deletions
diff --git a/lib/libc/gen/sysctlbyname.c b/lib/libc/gen/sysctlbyname.c
deleted file mode 100644
index 9c4f346..0000000
--- a/lib/libc/gen/sysctlbyname.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * ----------------------------------------------------------------------------
- * "THE BEER-WARE LICENSE" (Revision 42):
- * <phk@FreeBSD.org> wrote this file. As long as you retain this notice you
- * can do whatever you want with this stuff. If we meet some day, and you think
- * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
- * ----------------------------------------------------------------------------
- *
- * $Id: sysctlbyname.c,v 1.1 1997/05/30 20:53:13 phk Exp $
- *
- */
-#include <sys/types.h>
-#include <sys/sysctl.h>
-
-int
-sysctlbyname(const char *name, void *oldp, size_t *oldlenp, void *newp,
- size_t newlen)
-{
- int name2oid_oid[2];
- int real_oid[CTL_MAXNAME+2];
- int error, oidlen;
-
- name2oid_oid[0] = 0; /* This is magic & undocumented! */
- name2oid_oid[1] = 3;
-
- oidlen = sizeof(real_oid);
- error = sysctl(name2oid_oid, 2, real_oid, &oidlen, (void *)name,
- strlen(name));
- if (error < 0)
- return error;
- oidlen /= sizeof (int);
- error = sysctl(real_oid, oidlen, oldp, oldlenp, newp, newlen);
- return (error);
-}
-
OpenPOWER on IntegriCloud