Changeset View
Changeset View
Standalone View
Standalone View
top.c
Show All 28 Lines | |||||
* distinguish between different Unix implementations: | * distinguish between different Unix implementations: | ||||
* | * | ||||
* SIGHOLD - use SVR4 sighold function when defined | * SIGHOLD - use SVR4 sighold function when defined | ||||
* SIGRELSE - use SVR4 sigrelse function when defined | * SIGRELSE - use SVR4 sigrelse function when defined | ||||
* FD_SET - macros FD_SET and FD_ZERO are used when defined | * FD_SET - macros FD_SET and FD_ZERO are used when defined | ||||
*/ | */ | ||||
#include "os.h" | #include "os.h" | ||||
#include <errno.h> | |||||
#include <signal.h> | |||||
#include <setjmp.h> | |||||
#include <ctype.h> | |||||
#include <sys/jail.h> | #include <sys/jail.h> | ||||
#include <sys/time.h> | #include <sys/time.h> | ||||
#include <ctype.h> | |||||
#include <errno.h> | |||||
#include <jail.h> | #include <jail.h> | ||||
#include <setjmp.h> | |||||
#include <signal.h> | |||||
#include <unistd.h> | |||||
/* includes specific to top */ | /* includes specific to top */ | ||||
#include "commands.h" | |||||
#include "display.h" /* interface to display package */ | #include "display.h" /* interface to display package */ | ||||
#include "screen.h" /* interface to screen package */ | #include "screen.h" /* interface to screen package */ | ||||
#include "top.h" | #include "top.h" | ||||
#include "top.local.h" | #include "top.local.h" | ||||
#include "boolean.h" | #include "boolean.h" | ||||
#include "machine.h" | #include "machine.h" | ||||
#include "utils.h" | #include "utils.h" | ||||
#include "username.h" | |||||
/* Size of the stdio buffer given to stdout */ | /* Size of the stdio buffer given to stdout */ | ||||
#define Buffersize 2048 | #define Buffersize 2048 | ||||
/* The buffer that stdio will use */ | /* The buffer that stdio will use */ | ||||
char stdoutbuf[Buffersize]; | char stdoutbuf[Buffersize]; | ||||
/* build Signal masks */ | /* build Signal masks */ | ||||
▲ Show 20 Lines • Show All 48 Lines • ▼ Show 20 Lines | |||||
caddr_t get_process_info(); | caddr_t get_process_info(); | ||||
/* different routines for displaying the user's identification */ | /* different routines for displaying the user's identification */ | ||||
/* (values assigned to get_userid) */ | /* (values assigned to get_userid) */ | ||||
char *username(); | char *username(); | ||||
char *itoa7(); | char *itoa7(); | ||||
/* display routines that need to be predeclared */ | |||||
int i_loadave(); | |||||
int u_loadave(); | |||||
int i_procstates(); | |||||
int u_procstates(); | |||||
int i_cpustates(); | |||||
int u_cpustates(); | |||||
int i_memory(); | |||||
int u_memory(); | |||||
int i_arc(); | |||||
int u_arc(); | |||||
int i_swap(); | |||||
int u_swap(); | |||||
int i_message(); | |||||
int u_message(); | |||||
int i_header(); | |||||
int u_header(); | |||||
int i_process(); | |||||
int u_process(); | |||||
/* pointers to display routines */ | /* pointers to display routines */ | ||||
int (*d_loadave)() = i_loadave; | void (*d_loadave)() = i_loadave; | ||||
int (*d_procstates)() = i_procstates; | void (*d_procstates)() = i_procstates; | ||||
int (*d_cpustates)() = i_cpustates; | void (*d_cpustates)() = i_cpustates; | ||||
int (*d_memory)() = i_memory; | void (*d_memory)() = i_memory; | ||||
int (*d_arc)() = i_arc; | void (*d_arc)() = i_arc; | ||||
int (*d_swap)() = i_swap; | void (*d_swap)() = i_swap; | ||||
int (*d_message)() = i_message; | void (*d_message)() = i_message; | ||||
int (*d_header)() = i_header; | void (*d_header)() = i_header; | ||||
int (*d_process)() = i_process; | void (*d_process)() = i_process; | ||||
void reset_display(void); | |||||
int | |||||
main(argc, argv) | main(argc, argv) | ||||
int argc; | int argc; | ||||
char *argv[]; | char *argv[]; | ||||
{ | { | ||||
register int i; | register int i; | ||||
register int active_procs; | register int active_procs; | ||||
▲ Show 20 Lines • Show All 1,016 Lines • ▼ Show 20 Lines | #endif | ||||
/*NOTREACHED*/ | /*NOTREACHED*/ | ||||
} | } | ||||
/* | /* | ||||
* reset_display() - reset all the display routine pointers so that entire | * reset_display() - reset all the display routine pointers so that entire | ||||
* screen will get redrawn. | * screen will get redrawn. | ||||
*/ | */ | ||||
void | |||||
reset_display() | reset_display() | ||||
{ | { | ||||
d_loadave = i_loadave; | d_loadave = i_loadave; | ||||
d_procstates = i_procstates; | d_procstates = i_procstates; | ||||
d_cpustates = i_cpustates; | d_cpustates = i_cpustates; | ||||
d_memory = i_memory; | d_memory = i_memory; | ||||
d_arc = i_arc; | d_arc = i_arc; | ||||
▲ Show 20 Lines • Show All 43 Lines • Show Last 20 Lines |