1 /* This file is part of the Project Athena Zephyr Notification System.
2 * It contains system-dependent header code.
4 * Created by: Greg Hudson
6 * $Id: sysdep.h,v 1.3 1999/01/22 23:18:57 ghudson Exp $
7 * $Zephyr: /mit/zephyr/src/include/zephyr/RCS/zephyr_conf.h,v 1.8 90/12/21 17:40:40 raeburn Exp $
9 * Copyright (c) 1988,1991 by the Massachusetts Institute of Technology.
10 * For copying and distribution information, see the file
24 #include <sys/types.h>
26 #include <sys/param.h>
35 char *malloc(), *realloc();
37 char *getenv(), *strerror(), *ctime(), *strcpy();
39 ZEPHYR_INT32 random();
44 #define random lrand48
45 #define srandom srand48
53 extern char *sys_errlist[];
54 # define strerror(x) (sys_errlist[(x)])
63 # define strrchr rindex
65 char *strchr(), *strrchr();
67 # define memcpy(d, s, n) bcopy ((s), (d), (n))
71 # define memmove(d, s, n) bcopy ((s), (d), (n))
75 /* Exit status handling and wait(). */
76 #ifdef HAVE_SYS_WAIT_H
77 # include <sys/wait.h>
80 # define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
83 # define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
86 #ifdef HAVE_SYS_CDEFS_H
87 #include <sys/cdefs.h>
90 /* Because we have public header files (and our prototypes need to agree with
91 * those header files), use __STDC__ to guess whether the compiler can handle
92 * stdarg, const, and prototypes. */
95 # define VA_START(ap, last) va_start(ap, last)
100 # include <varargs.h>
101 # define VA_START(ap, last) va_start(ap)
110 /* A decent syslog */
111 #define OPENLOG(str, opts, facility) openlog(str, opts, facility)
113 /* Probably a 4.2-type syslog */
114 #define OPENLOG(str, opts, facility) openlog(str, opts)
123 # define TEMP_DIRECTORY _PATH_VARTMP
125 # define TEMP_DIRECTORY FOUND_TMP
131 # ifdef HAVE_SYS_FILE_H
132 # include <sys/file.h>
136 #ifdef HAVE_GETHOSTID
137 ZEPHYR_INT32 gethostid();
142 #define STDIN_FILENO 0
143 #define STDOUT_FILENO 1
144 #define STDERR_FILENO 2
147 #ifdef HAVE_TERMIOS_H
148 # include <termios.h>
150 # ifdef HAVE_SYS_FILIO_H
151 # include <sys/filio.h>
156 # ifdef HAVE_SYS_IOCTL_H
157 # include <sys/ioctl.h>
162 /* Kerberos compatibility. */
165 # include <krb_err.h>
167 # ifndef HAVE_KRB_GET_ERR_TEXT
168 # define krb_get_err_text(n) krb_err_txt[n]
170 # ifndef HAVE_KRB_LOG
175 #ifdef HAVE_SYS_UTSNAME_H
176 # include <sys/utsname.h>
179 #ifdef HAVE_SYS_SELECT_H
180 # include <sys/select.h>
183 #ifdef HAVE_SYS_MSGBUF_H
184 #include <sys/msgbuf.h>
188 #define MSG_BSIZE BUFSIZ
191 #endif /* __SYSDEP_H__ */