diff options
author | pirzyk <pirzyk@FreeBSD.org> | 2001-06-18 21:06:24 +0000 |
---|---|---|
committer | pirzyk <pirzyk@FreeBSD.org> | 2001-06-18 21:06:24 +0000 |
commit | 976a20fbb609b4ec96df216a63b4c6f242bb7d5f (patch) | |
tree | 2c68fb695620fc4d0f4bd3a9dabe0994dce000b2 /sbin | |
parent | 261a8db1801796be2b47e9381933e2fde980b6dc (diff) | |
download | FreeBSD-src-976a20fbb609b4ec96df216a63b4c6f242bb7d5f.zip FreeBSD-src-976a20fbb609b4ec96df216a63b4c6f242bb7d5f.tar.gz |
modfied sysctl command to allow setting values > 2GB if the mib supports it.
PR: kern/21132
Reviewed by: no objections to by -arch
MFC after: 1 month
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/sysctl/sysctl.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c index 7043582..1d22550 100644 --- a/sbin/sysctl/sysctl.c +++ b/sbin/sysctl/sysctl.c @@ -143,7 +143,11 @@ parse(char *string) { int len, i, j; void *newval = 0; - int intval, newsize = 0; + int intval; + unsigned int uintval; + long longval; + unsigned long ulongval; + size_t newsize = 0; quad_t quadval; int mib[CTL_MAXNAME]; char *cp, *bufp, buf[BUFSIZ]; @@ -188,6 +192,20 @@ parse(char *string) newval = &intval; newsize = sizeof(intval); break; + case CTLTYPE_UINT: + uintval = (int) strtoul(newval, NULL, 0); + newval = &uintval; + newsize = sizeof uintval; + break; + case CTLTYPE_LONG: + longval = strtol(newval, NULL, 0); + newval = &longval; + newsize = sizeof longval; + break; + case CTLTYPE_ULONG: + ulongval = strtoul(newval, NULL, 0); + newval = &ulongval; + newsize = sizeof ulongval; break; case CTLTYPE_STRING: break; |