prstat.c revision a851ab35aefb1a1a598d8569269a21059e3a4a4b
7033N/A * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
7033N/A * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
#include <zone.h>
#include <libzonecfg.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <dirent.h>
#include <string.h>
#include <errno.h>
#include <poll.h>
#include <ctype.h>
#include <fcntl.h>
#include <limits.h>
#include <signal.h>
#include <time.h>
#include <project.h>
#include <libintl.h>
#include <locale.h>
#include "prstat.h"
#include "prutil.h"
#include "prtable.h"
#include "prsort.h"
#include "prfile.h"
* of this file, we care about the curses.h ERR so include that last.
#if defined(ERR)
#include <curses.h>
#include <term.h>
#define PSINFO_HEADER_PROC \
#define PSINFO_HEADER_LWP \
#define USAGE_HEADER_PROC \
#define USAGE_HEADER_LWP \
#define USER_HEADER_PROC \
#define USER_HEADER_LWP \
#define TASK_HEADER_PROC \
#define TASK_HEADER_LWP \
#define PROJECT_HEADER_PROC \
#define PROJECT_HEADER_LWP \
#define ZONE_HEADER_PROC \
#define ZONE_HEADER_LWP \
#define PSINFO_LINE \
#define USAGE_LINE \
#define USER_LINE \
#define TASK_LINE \
#define PROJECT_LINE \
#define ZONE_LINE \
#define TOTAL_LINE \
int i, lwpid;
case LT_PROJECTS:
case LT_TASKS:
case LT_ZONES:
case LT_USERS:
case LT_LWPS:
case LT_PROJECTS:
case LT_TASKS:
case LT_USERS:
case LT_ZONES:
case LT_LWPS:
case LT_PROJECTS:
case LT_USERS:
case LT_TASKS:
case LT_ZONES:
case LT_LWPS:
static lwp_info_t *
return (lwp);
fd_closeall();
while (lwp) {
while (id) {
goto update;
float period;
char *pidstr;
total_procs = 0;
total_lwps = 0;
total_cpu = 0;
total_mem = 0;
int rep_lwp = 0;
nlwps = 0;
nlwps++;
== OPT_PSETS) {
if (rep_lwp == 0) {
if (nlwps == 0) {
total_procs++;
total_procs++;
fd_update();
(void) initscr();
(void) nonl();
(void) endwin();
nlines()
char *envp;
setsize()
static int oldn = 0;
n = nlines();
if (n == oldn)
oldn = n;
setmovecur();
int err;
switch (err) {
switch (sig) {
case SIGINT:
if (p == NULL)
if (p == NULL)
if (p == NULL)
Exit()
curses_off();
fd_exit();
int opt;
int timeout;
char key;
lwpid_init();
!= (int)EOF) {
switch (opt) {
Usage();
Usage();
(void) setsize();
curses_on();
set_signals();
curses_off();
sigtstp = 0;
curses_on();
sigwinch = 0;
if (print_movecur)