summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorguenther <guenther@openbsd.org>2011-10-13 01:15:04 +0000
committerguenther <guenther@openbsd.org>2011-10-13 01:15:04 +0000
commit1601eb99c1a7efff366c7992e86eaec693221984 (patch)
tree9e79c46a00d9724a4af92b6efd007270f19093bd
parentConvert rfork_thread() from int$80 to syscall. (diff)
downloadwireguard-openbsd-1601eb99c1a7efff366c7992e86eaec693221984.tar.xz
wireguard-openbsd-1601eb99c1a7efff366c7992e86eaec693221984.zip
Remove support for systems that lack CPUs. (i.e., stop looking up
HW_NCPU when the only test was whether it's non-zero) ok millert@
-rw-r--r--bin/ps/print.c5
-rw-r--r--bin/ps/ps.c14
2 files changed, 4 insertions, 15 deletions
diff --git a/bin/ps/print.c b/bin/ps/print.c
index 47b135c9492..95d2cf7571a 100644
--- a/bin/ps/print.c
+++ b/bin/ps/print.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print.c,v 1.49 2011/09/25 00:32:47 guenther Exp $ */
+/* $OpenBSD: print.c,v 1.50 2011/10/13 01:15:04 guenther Exp $ */
/* $NetBSD: print.c,v 1.27 1995/09/29 21:58:12 cgd Exp $ */
/*-
@@ -197,7 +197,6 @@ logname(const struct kinfo_proc *kp, VARENT *ve)
void
state(const struct kinfo_proc *kp, VARENT *ve)
{
- extern int ncpu;
int flag;
char *cp, state = '\0';
VAR *v;
@@ -258,7 +257,7 @@ state(const struct kinfo_proc *kp, VARENT *ve)
*cp++ = '+';
*cp = '\0';
- if (state == 'R' && ncpu && kp->p_cpuid != KI_NOCPU) {
+ if (state == 'R' && kp->p_cpuid != KI_NOCPU) {
char pbuf[16];
snprintf(pbuf, sizeof pbuf, "/%llu", kp->p_cpuid);
diff --git a/bin/ps/ps.c b/bin/ps/ps.c
index 91e459ff11a..d4f90a48b66 100644
--- a/bin/ps/ps.c
+++ b/bin/ps/ps.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ps.c,v 1.50 2011/09/25 00:29:59 guenther Exp $ */
+/* $OpenBSD: ps.c,v 1.51 2011/10/13 01:15:04 guenther Exp $ */
/* $NetBSD: ps.c,v 1.15 1995/05/18 20:33:25 mycroft Exp $ */
/*-
@@ -37,8 +37,6 @@
#include <sys/proc.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
-#include <sys/sysctl.h>
-#include <sys/types.h>
#include <ctype.h>
#include <err.h>
@@ -66,8 +64,6 @@ int sumrusage; /* -S */
int termwidth; /* width of screen (0 == infinity) */
int totwidth; /* calculated width of requested variables */
-int ncpu = 1;
-
int needcomm, needenv, neednlist, commandonly;
enum sort { DEFAULT, SORTMEM, SORTCPU } sortby = DEFAULT;
@@ -98,10 +94,9 @@ main(int argc, char *argv[])
dev_t ttydev;
pid_t pid;
uid_t uid;
- int all, ch, flag, i, fmt, lineno, nentries, mib[6];
+ int all, ch, flag, i, fmt, lineno, nentries;
int prtheader, showthreads, wflag, kflag, what, Uflag, xflg;
char *nlistf, *memf, *swapf, errbuf[_POSIX2_LINE_MAX];
- size_t size;
if ((ioctl(STDOUT_FILENO, TIOCGWINSZ, &ws) == -1 &&
ioctl(STDERR_FILENO, TIOCGWINSZ, &ws) == -1 &&
@@ -308,11 +303,6 @@ main(int argc, char *argv[])
flag = 0;
}
- mib[0] = CTL_HW;
- mib[1] = HW_NCPU;
- size = sizeof(ncpu);
- (void) sysctl(mib, 2, &ncpu, &size, NULL, 0);
-
/*
* select procs
*/