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 2145 2008-01-21 16:20:29Z kcr $
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
26 #define __USE_XOPEN_EXTENDED
29 #ifdef __USE_XOPEN_EXTENDED
30 #undef __USE_XOPEN_EXTENDED
33 #include <sys/types.h>
35 #include <sys/param.h>
44 char *malloc(), *realloc();
46 char *getenv(), *strerror(), *ctime(), *strcpy();
48 ZEPHYR_INT32 random();
53 #define random lrand48
54 #define srandom srand48
62 extern char *sys_errlist[];
63 # define strerror(x) (sys_errlist[(x)])
72 # define strrchr rindex
74 char *strchr(), *strrchr();
76 # define memcpy(d, s, n) bcopy ((s), (d), (n))
80 # define memmove(d, s, n) bcopy ((s), (d), (n))
84 /* Exit status handling and wait(). */
85 #ifdef HAVE_SYS_WAIT_H
86 # include <sys/wait.h>
89 # define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
92 # define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
95 #ifdef HAVE_SYS_CDEFS_H
96 #include <sys/cdefs.h>
99 /* Because we have public header files (and our prototypes need to agree with
100 * those header files), use __STDC__ to guess whether the compiler can handle
101 * stdarg, const, and prototypes. */
104 # define VA_START(ap, last) va_start(ap, last)
109 # include <varargs.h>
110 # define VA_START(ap, last) va_start(ap)
119 /* A decent syslog */
120 #define OPENLOG(str, opts, facility) openlog(str, opts, facility)
122 /* Probably a 4.2-type syslog */
123 #define OPENLOG(str, opts, facility) openlog(str, opts)
132 # define TEMP_DIRECTORY _PATH_VARTMP
134 # define TEMP_DIRECTORY FOUND_TMP
140 # ifdef HAVE_SYS_FILE_H
141 # include <sys/file.h>
145 #ifdef HAVE_GETHOSTID
146 ZEPHYR_INT32 gethostid();
151 #define STDIN_FILENO 0
152 #define STDOUT_FILENO 1
153 #define STDERR_FILENO 2
156 #ifdef HAVE_TERMIOS_H
157 # include <termios.h>
159 # ifdef HAVE_SYS_FILIO_H
160 # include <sys/filio.h>
165 # ifdef HAVE_SYS_IOCTL_H
166 # include <sys/ioctl.h>
171 /* Kerberos compatibility. */
174 # include <krb_err.h>
176 # ifndef HAVE_KRB_GET_ERR_TEXT
177 # define krb_get_err_text(n) krb_err_txt[n]
179 # ifndef HAVE_KRB_LOG
184 #ifdef HAVE_SYS_UTSNAME_H
185 # include <sys/utsname.h>
188 #ifdef HAVE_SYS_SELECT_H
189 # include <sys/select.h>
192 #ifdef HAVE_SYS_MSGBUF_H
193 #include <sys/msgbuf.h>
197 #define MSG_BSIZE BUFSIZ
200 #endif /* __SYSDEP_H__ */