Changeset View
Changeset View
Standalone View
Standalone View
head/usr.bin/top/top.c
Show All 19 Lines | |||||
#include <sys/select.h> | #include <sys/select.h> | ||||
#include <sys/signal.h> | #include <sys/signal.h> | ||||
#include <assert.h> | #include <assert.h> | ||||
#include <err.h> | #include <err.h> | ||||
#include <errno.h> | #include <errno.h> | ||||
#include <getopt.h> | #include <getopt.h> | ||||
#include <jail.h> | #include <jail.h> | ||||
#include <locale.h> | |||||
#include <stdbool.h> | #include <stdbool.h> | ||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
#include <signal.h> | #include <signal.h> | ||||
#include <string.h> | #include <string.h> | ||||
#include <unistd.h> | #include <unistd.h> | ||||
#include "commands.h" | #include "commands.h" | ||||
▲ Show 20 Lines • Show All 223 Lines • ▼ Show 20 Lines | char *nptr; | ||||
/* set the buffer for stdout */ | /* set the buffer for stdout */ | ||||
#ifdef DEBUG | #ifdef DEBUG | ||||
extern FILE *debug; | extern FILE *debug; | ||||
debug = fopen("debug.run", "w"); | debug = fopen("debug.run", "w"); | ||||
setbuffer(stdout, NULL, 0); | setbuffer(stdout, NULL, 0); | ||||
#else | #else | ||||
setbuffer(stdout, stdoutbuf, Buffersize); | setbuffer(stdout, stdoutbuf, Buffersize); | ||||
#endif | #endif | ||||
if (setlocale(LC_ALL, "") == NULL) { | |||||
fprintf(stderr, "invalid locale.\n"); | |||||
exit(1); | |||||
} | |||||
mypid = getpid(); | mypid = getpid(); | ||||
/* get our name */ | /* get our name */ | ||||
/* initialize some selection options */ | /* initialize some selection options */ | ||||
ps.idle = true; | ps.idle = true; | ||||
ps.self = true; | ps.self = true; | ||||
ps.system = false; | ps.system = false; | ||||
▲ Show 20 Lines • Show All 924 Lines • Show Last 20 Lines |