1 /* Copyright 1993 by Paul Vixie
4 * Distribute freely, except: don't remove my name from the source or
5 * documentation (don't take credit for my work), mark your changes (don't
6 * get me blamed for your possible bugs), don't alter or remove this
7 * notice. May be sold if buildable source is provided to buyer. No
8 * warrantee of any kind, express or implied, is included with this
9 * software; use at your own risk, responsibility for damages (if any) to
10 * anyone resulting from the use of this software rests entirely with the
13 * Send bug reports, bug fixes, enhancements, requests, flames, etc., and
14 * I'll try to keep a version up to date. I can be reached as follows:
15 * Paul Vixie <paul@vix.com> uunet!decwrl!vixie!paul
18 #if defined(POSIX) || defined(ATT)
23 # define DIR_T struct dirent
25 # define WAIT_IS_INT 1
26 extern char *tzname
[2];
27 # define TZONE(tm) tzname[(tm).tm_isdst]
33 # define WAIT_T union wait
38 # define TIME_T time_t
48 #if !defined(POSIX) && !defined(ATT)
51 extern unsigned sleep();
52 extern struct tm
*localtime();
53 extern struct passwd
*getpwnam();
55 extern void perror(), exit(), free();
56 extern char *getenv(), *strcpy(), *strchr(), *strtok();
57 extern void *malloc(), *realloc();
61 # define WAIT_T union wait
62 # define DIR_T struct direct
64 # define TZONE(tm) (tm).tm_zone
67 /* getopt() isn't part of POSIX. some systems define it in <stdlib.h> anyway.
68 * of those that do, some complain that our definition is different and some
69 * do not. to add to the misery and confusion, some systems define getopt()
70 * in ways that we cannot predict or comprehend, yet do not define the adjunct
71 * external variables needed for the interface.
73 #if (!defined(BSD) || (BSD < 198911)) && !defined(ATT) && !defined(UNICOS)
74 int getopt
__P((int, char * const *, const char *));
77 #if (!defined(BSD) || (BSD < 199103))
79 extern int optind
, opterr
, optopt
;
84 # define WEXITSTATUS(x) (((x) >> 8) & 0xff)
87 # define WTERMSIG(x) ((x) & 0x7f)
90 # define WCOREDUMP(x) ((x) & 0x80)
94 # define WEXITSTATUS(x) ((x).w_retcode)
97 # define WTERMSIG(x) ((x).w_termsig)
100 # define WCOREDUMP(x) ((x).w_coredump)
102 #endif /*WAIT_IS_INT*/
105 #define WIFSIGNALED(x) (WTERMSIG(x) != 0)
108 #define WIFEXITED(x) (WTERMSIG(x) == 0)
111 #ifdef NEED_STRCASECMP
112 extern int strcasecmp
__P((char *, char *));
116 extern char *strdup
__P((char *));
120 extern char *strerror
__P((int));
124 extern int flock
__P((int, int));
132 extern int setsid
__P((void));
135 #ifdef NEED_GETDTABLESIZE
136 extern int getdtablesize
__P((void));
140 extern int setenv
__P((char *, char *, int));
144 extern PID_T vfork
__P((void));