top.c (224205) | top.c (232239) |
---|---|
1char *copyright = 2 "Copyright (c) 1984 through 1996, William LeFebvre"; 3 4/* 5 * Top users/processes display for Unix 6 * Version 3 7 * 8 * This program may be freely redistributed, 9 * but this entire comment MUST remain intact. 10 * 11 * Copyright (c) 1984, 1989, William LeFebvre, Rice University 12 * Copyright (c) 1989 - 1994, William LeFebvre, Northwestern University 13 * Copyright (c) 1994, 1995, William LeFebvre, Argonne National Laboratory 14 * Copyright (c) 1996, William LeFebvre, Group sys Consulting 15 * | 1char *copyright = 2 "Copyright (c) 1984 through 1996, William LeFebvre"; 3 4/* 5 * Top users/processes display for Unix 6 * Version 3 7 * 8 * This program may be freely redistributed, 9 * but this entire comment MUST remain intact. 10 * 11 * Copyright (c) 1984, 1989, William LeFebvre, Rice University 12 * Copyright (c) 1989 - 1994, William LeFebvre, Northwestern University 13 * Copyright (c) 1994, 1995, William LeFebvre, Argonne National Laboratory 14 * Copyright (c) 1996, William LeFebvre, Group sys Consulting 15 * |
16 * $FreeBSD: head/contrib/top/top.c 224205 2011-07-18 21:15:47Z jhb $ | 16 * $FreeBSD: head/contrib/top/top.c 232239 2012-02-27 20:52:20Z kib $ |
17 */ 18 19/* 20 * See the file "Changes" for information on version-to-version changes. 21 */ 22 23/* 24 * This file contains "main" and other high-level routines. --- 40 unchanged lines hidden (view full) --- 65/* imported from screen.c */ 66extern int overstrike; 67 68static int fmt_flags = 0; 69int pcpu_stats = No; 70 71/* signal handling routines */ 72sigret_t leave(); | 17 */ 18 19/* 20 * See the file "Changes" for information on version-to-version changes. 21 */ 22 23/* 24 * This file contains "main" and other high-level routines. --- 40 unchanged lines hidden (view full) --- 65/* imported from screen.c */ 66extern int overstrike; 67 68static int fmt_flags = 0; 69int pcpu_stats = No; 70 71/* signal handling routines */ 72sigret_t leave(); |
73sigret_t onalrm(); | |
74sigret_t tstop(); 75#ifdef SIGWINCH 76sigret_t winch(); 77#endif 78 79volatile sig_atomic_t leaveflag; 80volatile sig_atomic_t tstopflag; 81volatile sig_atomic_t winchflag; --- 636 unchanged lines hidden (view full) --- 718 d_header = u_header; 719 d_process = u_process; 720 } 721 } 722 723 no_command = Yes; 724 if (!interactive) 725 { | 73sigret_t tstop(); 74#ifdef SIGWINCH 75sigret_t winch(); 76#endif 77 78volatile sig_atomic_t leaveflag; 79volatile sig_atomic_t tstopflag; 80volatile sig_atomic_t winchflag; --- 636 unchanged lines hidden (view full) --- 717 d_header = u_header; 718 d_process = u_process; 719 } 720 } 721 722 no_command = Yes; 723 if (!interactive) 724 { |
726 /* set up alarm */ 727 (void) signal(SIGALRM, onalrm); 728 (void) alarm((unsigned)delay); 729 730 /* wait for the rest of it .... */ 731 pause(); | 725 sleep(delay); |
732 } 733 else while (no_command) 734 { 735 /* assume valid command unless told otherwise */ 736 no_command = No; 737 738 /* set up arguments for select with timeout */ 739 FD_ZERO(&readfds); --- 429 unchanged lines hidden (view full) --- 1169 1170int status; 1171 1172{ 1173 end_screen(); 1174 exit(status); 1175 /*NOTREACHED*/ 1176} | 726 } 727 else while (no_command) 728 { 729 /* assume valid command unless told otherwise */ 730 no_command = No; 731 732 /* set up arguments for select with timeout */ 733 FD_ZERO(&readfds); --- 429 unchanged lines hidden (view full) --- 1163 1164int status; 1165 1166{ 1167 end_screen(); 1168 exit(status); 1169 /*NOTREACHED*/ 1170} |
1177 1178sigret_t onalrm() /* SIGALRM handler */ 1179 1180{ 1181 /* this is only used in batch mode to break out of the pause() */ 1182 /* return; */ 1183} 1184 | |