summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/bin/process.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/bin/process.c b/src/bin/process.c
index 42796c7..62ca69d 100644
--- a/src/bin/process.c
+++ b/src/bin/process.c
@@ -457,7 +457,10 @@ _process_list_freebsd_get(void)
457 struct kinfo_proc kp; 457 struct kinfo_proc kp;
458 int mib[4]; 458 int mib[4];
459 size_t len; 459 size_t len;
460 int pagesize = getpagesize(); 460 static int pagesize = 0;
461
462 if (!pagesize)
463 pagesize = getpagesize();
461 464
462 list = NULL; 465 list = NULL;
463 466
@@ -510,7 +513,9 @@ proc_info_by_pid(int pid)
510 struct kinfo_proc kp; 513 struct kinfo_proc kp;
511 int mib[4]; 514 int mib[4];
512 size_t len; 515 size_t len;
513 int pagesize = getpagesize(); 516 static int pagesize = 0;
517
518 if (!pagesize) pagesize = getpagesize();
514 519
515 len = sizeof(int); 520 len = sizeof(int);
516 if (sysctlnametomib("kern.proc.pid", mib, &len) == -1) 521 if (sysctlnametomib("kern.proc.pid", mib, &len) == -1)