Lines Matching +full:idle +full:- +full:wait +full:- +full:delay

1 /*-
8 * Copyright (c) 1989 - 1994, William LeFebvre, Northwestern University
88 { "cpu-display-mode", no_argument, NULL, 'C' }, /* differs from orignal */
91 { "idle-procs", no_argument, NULL, 'I' },
93 { "per-cpu", no_argument, NULL, 'P' },
94 { "system-procs", no_argument, NULL, 'S' },
95 { "thread-id", no_argument, NULL, 'T' }, /* differs from orignal */
102 { "jail-id", no_argument, NULL, 'j' },
103 { "display-mode", required_argument, NULL, 'm' },
105 { "sort-order", required_argument, NULL, 'o' },
108 { "delay", required_argument, NULL, 's' },
113 { "system-idle-procs", no_argument, NULL, 'z' },
121 ps.uid[i] = -1; in reset_uids()
132 if (ps.uid[i] == -1 || ps.uid[i] == uid) in add_uid()
148 /* Look for the user to remove - no problem if it's not there */ in rem_uid()
151 if (ps.uid[i] == -1) in rem_uid()
160 ps.uid[where] = ps.uid[i-1]; in rem_uid()
161 ps.uid[i-1] = -1; in rem_uid()
169 int uid = -1; in handle_user()
179 if (buf[0] == '+' || buf[0] == '-') in handle_user()
190 if ((uid = userid(buf2)) == -1) in handle_user()
235 struct timeval delay = { 2, 0 }; in main() local
246 int ac = -1; in main()
277 ps.idle = true; in main()
283 ps.jid = -1; in main()
287 ps.pid = -1; in main()
327 if ((ps.uid[0] = userid(optarg)) == -1) in main()
337 case 'I': /* show idle processes */ in main()
338 ps.idle = !ps.idle; in main()
345 case 'n': /* batch, or non-interactive */ in main()
357 warnx("warning: display count should be positive -- option ignored"); in main()
384 warnx("warning: invalid delay"); in main()
389 warnx("warning: seconds delay should be positive -- using default"); in main()
394 delay.tv_sec = delay_d; in main()
395 delay.tv_usec = (delay_d - delay.tv_sec) * 1e6; in main()
403 if (i == -1 && errno != 0) { in main()
404 warnx("warning: `-q' option failed (%m)"); in main()
415 errx(1, "warning: `-m' option can only take args 'io' or 'cpu'"); in main()
444 if ((ps.jid = jail_getid(optarg)) == -1) in main()
466 "[-abCHIijnPqStuvwz] [-d count] [-J jail] [-m cpu | io] [-o field]\n" in main()
467 " [-p pid] [-s time] [-U username] [number]"); in main()
476 warnx("warning: process display count should be non-negative -- using default"); in main()
500 if (machine_init(&statics) == -1) in main()
508 if ((order_index = string_index(order_name, statics.order_names)) == -1) in main()
531 if ((max_topn = display_init(&statics)) == -1) in main()
599 * main loop -- repeat while display count is positive or while it in main()
600 * indicates infinity (by being -1) in main()
603 while ((displays == -1) || (displays-- > 0)) in main()
676 /* do end-screen processing */ in main()
715 timeout = delay; in main()
730 timeout = delay; in main()
746 sigsetmask(sigblock(0) & ~(1 << (SIGTSTP - 1))); in main()
774 /* wait for either input or the end of the delay period */ in main()
784 /* something to read -- clear the message area first */ in main()
791 /* read error: either 0 or -1 */ in main()
800 while (cptr->c != '\0') { in main()
801 if (cptr->c == ch) { in main()
806 if (cptr->c == '\0') { in main()
811 if (overstrike && !cptr->available_to_dumb) in main()
819 switch(cptr->id) in main()
864 if (newval > -1) in main()
889 case CMD_delay: /* new seconds delay */ in main()
890 new_message(MT_standout, "Seconds to delay: "); in main()
896 new_message(MT_standout, " Invalid delay"); in main()
902 delay.tv_sec = delay_d; in main()
903 delay.tv_usec = (delay_d - delay.tv_sec) * 1e6; in main()
925 displays == -1 ? "infinite" : in main()
973 ps.idle = !ps.idle; in main()
975 " %sisplaying idle processes.", in main()
976 ps.idle ? "D" : "Not d"); in main()
1050 if ((i = string_index(tempbuf2, statics.order_names)) == -1) in main()
1085 ps.jid = -1; in main()
1087 else if ((i = jail_getid(tempbuf2)) == -1) in main()
1117 " %sisplaying system idle process.", in main()
1125 pcpu_stats ? "per-" : "global "); in main()
1134 " %sisplaying per-process swap usage.", in main()
1146 ps.pid = (pid_t)-1; in main()
1185 * reset_display() - reset all the display routine pointers so that entire
1209 leave(int i __unused) /* exit under normal conditions -- INT handler */ in leave()