aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorBruce Evans <bde@FreeBSD.org>1998-09-10 18:06:28 +0000
committerBruce Evans <bde@FreeBSD.org>1998-09-10 18:06:28 +0000
commite36039e73122f0736d0881de4fbd3802a0852ee4 (patch)
treef7155d778a43c396da378927a1ab6c6618f8ab5b /bin
parent486a7ab25b36094da94a5aca97d56f85040e4028 (diff)
Notes
Diffstat (limited to 'bin')
-rw-r--r--bin/ps/nlist.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/bin/ps/nlist.c b/bin/ps/nlist.c
index 47aa6e9098e12..d950e1bd9381c 100644
--- a/bin/ps/nlist.c
+++ b/bin/ps/nlist.c
@@ -31,8 +31,10 @@
* SUCH DAMAGE.
*/
-#include <sys/time.h>
-#include <sys/resource.h>
+#include <sys/types.h>
+#include <sys/sysctl.h>
+
+#include <stddef.h>
fixpt_t ccpu; /* kernel _ccpu variable */
int nlistread; /* if nlist already read. */
@@ -42,12 +44,16 @@ int fscale; /* kernel _fscale variable */
int
donlist()
{
+ size_t oldlen;
- if (sysctlbyname("kern.ccpu", &ccpu, sizeof ccpu, 0, 0) < 0)
+ oldlen = sizeof(ccpu);
+ if (sysctlbyname("kern.ccpu", &ccpu, &oldlen, NULL, 0) < 0)
return (1);
- if (sysctlbyname("kern.fscale", &fscale, sizeof fscale, 0, 0) < 0)
+ oldlen = sizeof(fscale);
+ if (sysctlbyname("kern.fscale", &fscale, &oldlen, NULL, 0) < 0)
return (1);
- if (sysctlbyname("hw.availpages", &mempages, sizeof mempages, 0, 0) < 0)
+ oldlen = sizeof(mempages);
+ if (sysctlbyname("hw.availpages", &mempages, &oldlen, NULL, 0) < 0)
return (1);
nlistread = 1;
return (0);