top(1): unconditionally assume we are running on FreeBSD

This allows us to remove a special header and more specifically just the
system headers we want.
This commit is contained in:
Eitan Adler 2018-05-19 23:19:24 +00:00
parent 8a133278b7
commit caee48830b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=333902
6 changed files with 20 additions and 49 deletions

View File

@ -18,14 +18,15 @@
* "top" (i.e.: changing the number of processes to display).
*/
#include "os.h"
#include <sys/time.h>
#include <sys/resource.h>
#include <ctype.h>
#include <errno.h>
#include <signal.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include "commands.h"

View File

@ -28,12 +28,13 @@
* *_process, u_endscreen.
*/
#include "os.h"
#include <sys/time.h>
#include <curses.h>
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <termcap.h>
#include <time.h>
#include <unistd.h>
@ -927,7 +928,7 @@ char *thisline;
p = strecpy(base, thisline);
/* zero fill the rest of it */
memzero(p, display_width - (p - base));
bzero(p, display_width - (p - base));
}
void
@ -970,7 +971,7 @@ char *newline;
optr = strecpy(bufferline, newline);
/* zero fill the rest of it */
memzero(optr, display_width - (optr - bufferline));
bzero(optr, display_width - (optr - bufferline));
}
else
{
@ -1381,7 +1382,7 @@ int line;
diff = display_width - newcol;
if (diff > 0)
{
memzero(old, diff);
bzero(old, diff);
}
/* remember where the current line is */

View File

@ -1,38 +0,0 @@
#include <sys/types.h>
#include <sys/param.h> /* This defines BSD */
#if defined(BSD) && !defined(BSD4_4) && !defined(__osf__)
# include <stdio.h>
# include <strings.h>
# define strchr(a, b) index((a), (b))
# define strrchr(a, b) rindex((a), (b))
# define memcpy(a, b, c) bcopy((b), (a), (c))
# define memzero(a, b) bzero((a), (b))
# define memcmp(a, b, c) bcmp((a), (b), (c))
#if defined(NeXT)
typedef void sigret_t;
#else
typedef int sigret_t;
#endif
/* system routines that don't return int */
char *getenv();
caddr_t malloc();
#else
# include <stdio.h>
# define setbuffer(f, b, s) setvbuf((f), (b), (b) ? _IOFBF : _IONBF, (s))
# include <string.h>
# include <memory.h>
# include <stdlib.h>
# define memzero(a, b) memset((a), 0, (b))
typedef void sigret_t;
#endif
/* some systems declare sys_errlist in stdio.h! */
#if defined(__NetBSD__) || defined(__FreeBSD__)
#if !defined(__m68k__)
# if !defined(__NetBSD132__)
#define SYS_ERRLIST_DECLARED
# endif /* __NetBSD132__ */
#endif
#endif

View File

@ -20,10 +20,10 @@
* preprocessor variable "TOStop". --wnl
*/
#include "os.h"
#include "top.h"
#include <sys/ioctl.h>
#include <string.h>
#ifdef CBREAK
# include <sgtty.h>
# define SGTTY

View File

@ -33,8 +33,8 @@ char *copyright =
* FD_SET - macros FD_SET and FD_ZERO are used when defined
*/
#include "os.h"
#include <sys/types.h>
#include <sys/param.h>
#include <sys/jail.h>
#include <sys/time.h>
@ -43,7 +43,9 @@ char *copyright =
#include <errno.h>
#include <jail.h>
#include <setjmp.h>
#include <stdlib.h>
#include <signal.h>
#include <string.h>
#include <unistd.h>
/* includes specific to top */
@ -60,6 +62,8 @@ char *copyright =
/* Size of the stdio buffer given to stdout */
#define Buffersize 2048
typedef void sigret_t;
/* The buffer that stdio will use */
char stdoutbuf[Buffersize];

View File

@ -16,7 +16,10 @@
*/
#include "top.h"
#include "os.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
int atoiwi(str)