1 /* 2 * Copyright (c) 1989, 1990, 1993, 1994, 1995, 1996 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that: (1) source code distributions 7 * retain the above copyright notice and this paragraph in its entirety, (2) 8 * distributions including binary code include the above copyright notice and 9 * this paragraph in its entirety in the documentation or other materials 10 * provided with the distribution, and (3) all advertising materials mentioning 11 * features or use of this software display the following acknowledgement: 12 * ``This product includes software developed by the University of California, 13 * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of 14 * the University nor the names of its contributors may be used to endorse 15 * or promote products derived from this software without specific prior 16 * written permission. 17 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED 18 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF 19 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 20 * 21 * @(#) $Header: os-sunos4.h,v 1.31 96/06/24 02:39:07 leres Exp $ (LBL) 22 */ 23 24 #define SIGRET void 25 #define SIGRETVAL 26 #define WAITSTATUS int 27 28 /* Prototypes missing in SunOS 4 */ 29 #ifdef FILE 30 int _filbuf(FILE *); 31 int _flsbuf(u_char, FILE *); 32 int fclose(FILE *); 33 int fflush(FILE *); 34 int fgetc(FILE *); 35 int fprintf(FILE *, const char *, ...); 36 int fputc(int, FILE *); 37 int fputs(const char *, FILE *); 38 u_int fread(void *, u_int, u_int, FILE *); 39 int fseek(FILE *, long, int); 40 u_int fwrite(const void *, u_int, u_int, FILE *); 41 int pclose(FILE *); 42 void rewind(FILE *); 43 void setbuf(FILE *, char *); 44 int setlinebuf(FILE *); 45 int ungetc(int, FILE *); 46 int vfprintf(FILE *, const char *, ...); 47 int vprintf(const char *, ...); 48 #endif 49 50 #if __GNUC__ <= 1 51 int read(int, char *, u_int); 52 int write(int, char *, u_int); 53 #endif 54 55 long a64l(const char *); 56 #ifdef __STDC__ 57 struct sockaddr; 58 #endif 59 int accept(int, struct sockaddr *, int *); 60 int bind(int, struct sockaddr *, int); 61 int bcmp(const void *, const void *, u_int); 62 void bcopy(const void *, void *, u_int); 63 void bzero(void *, int); 64 int chroot(const char *); 65 int close(int); 66 void closelog(void); 67 int connect(int, struct sockaddr *, int); 68 char *crypt(const char *, const char *); 69 int daemon(int, int); 70 int fchmod(int, int); 71 int fchown(int, int, int); 72 void endgrent(void); 73 void endpwent(void); 74 void endservent(void); 75 #ifdef __STDC__ 76 struct ether_addr; 77 #endif 78 struct ether_addr *ether_aton(const char *); 79 int flock(int, int); 80 #ifdef __STDC__ 81 struct stat; 82 #endif 83 int fstat(int, struct stat *); 84 #ifdef __STDC__ 85 struct statfs; 86 #endif 87 int fstatfs(int, struct statfs *); 88 int fsync(int); 89 #ifdef __STDC__ 90 struct timeb; 91 #endif 92 int ftime(struct timeb *); 93 int ftruncate(int, off_t); 94 int getdtablesize(void); 95 long gethostid(void); 96 int gethostname(char *, int); 97 int getopt(int, char * const *, const char *); 98 int getpagesize(void); 99 char *getpass(char *); 100 int getpeername(int, struct sockaddr *, int *); 101 int getpriority(int, int); 102 #ifdef __STDC__ 103 struct rlimit; 104 #endif 105 int getrlimit(int, struct rlimit *); 106 int getsockname(int, struct sockaddr *, int *); 107 int getsockopt(int, int, int, char *, int *); 108 #ifdef __STDC__ 109 struct timeval; 110 struct timezone; 111 #endif 112 int gettimeofday(struct timeval *, struct timezone *); 113 char *getusershell(void); 114 char *getwd(char *); 115 int initgroups(const char *, int); 116 int ioctl(int, int, caddr_t); 117 int iruserok(u_long, int, char *, char *); 118 int isatty(int); 119 int killpg(int, int); 120 int listen(int, int); 121 #ifdef __STDC__ 122 struct utmp; 123 #endif 124 void login(struct utmp *); 125 int logout(const char *); 126 off_t lseek(int, off_t, int); 127 int lstat(const char *, struct stat *); 128 int mkstemp(char *); 129 char *mktemp(char *); 130 int munmap(caddr_t, int); 131 void openlog(const char *, int, int); 132 void perror(const char *); 133 int printf(const char *, ...); 134 int puts(const char *); 135 long random(void); 136 int readlink(const char *, char *, int); 137 #ifdef __STDC__ 138 struct iovec; 139 #endif 140 int readv(int, struct iovec *, int); 141 int recv(int, char *, u_int, int); 142 int recvfrom(int, char *, u_int, int, struct sockaddr *, int *); 143 int rename(const char *, const char *); 144 int rcmd(char **, u_short, char *, char *, char *, int *); 145 int rresvport(int *); 146 int send(int, char *, u_int, int); 147 int sendto(int, char *, u_int, int, struct sockaddr *, int); 148 int setenv(const char *, const char *, int); 149 int seteuid(int); 150 int setpriority(int, int, int); 151 int select(int, fd_set *, fd_set *, fd_set *, struct timeval *); 152 int setpgrp(int, int); 153 void setpwent(void); 154 int setrlimit(int, struct rlimit *); 155 void setservent(int); 156 int setsockopt(int, int, int, char *, int); 157 int shutdown(int, int); 158 int sigblock(int); 159 void (*signal (int, void (*) (int))) (int); 160 int sigpause(int); 161 int sigsetmask(int); 162 #ifdef __STDC__ 163 struct sigvec; 164 #endif 165 int sigvec(int, struct sigvec *, struct sigvec*); 166 int snprintf(char *, size_t, const char *, ...); 167 int socket(int, int, int); 168 int socketpair(int, int, int, int *); 169 int symlink(const char *, const char *); 170 void srandom(int); 171 int sscanf(char *, const char *, ...); 172 int stat(const char *, struct stat *); 173 int statfs(char *, struct statfs *); 174 char *strerror(int); 175 int strcasecmp(const char *, const char *); 176 #ifdef __STDC__ 177 struct tm; 178 #endif 179 int strftime(char *, int, char *, struct tm *); 180 int strncasecmp(const char *, const char *, int); 181 long strtol(const char *, char **, int); 182 void sync(void); 183 void syslog(int, const char *, ...); 184 int system(const char *); 185 long tell(int); 186 time_t time(time_t *); 187 char *timezone(int, int); 188 int tolower(int); 189 int toupper(int); 190 int truncate(char *, off_t); 191 void unsetenv(const char *); 192 int vfork(void); 193 int vsprintf(char *, const char *, ...); 194 int writev(int, struct iovec *, int); 195 #ifdef __STDC__ 196 struct rusage; 197 #endif 198 int utimes(const char *, struct timeval *); 199 #if __GNUC__ <= 1 200 int wait(int *); 201 pid_t wait3(int *, int, struct rusage *); 202 #endif 203 204 extern int opterr, optind, optopt; 205 extern char *optarg; 206 207 /* Map protocol types */ 208 #define ETHERPUP_IPTYPE ETHERTYPE_IP 209 #define ETHERPUP_REVARPTYPE ETHERTYPE_REVARP 210 #define ETHERPUP_ARPTYPE ETHERTYPE_ARP 211 212 /* Ugly signal hacking */ 213 #ifdef SIG_ERR 214 #undef SIG_ERR 215 #define SIG_ERR (void (*)(int))-1 216 #undef SIG_DFL 217 #define SIG_DFL (void (*)(int))0 218 #undef SIG_IGN 219 #define SIG_IGN (void (*)(int))1 220 221 #ifdef KERNEL 222 #undef SIG_CATCH 223 #define SIG_CATCH (void (*)(int))2 224 #endif 225 #undef SIG_HOLD 226 #define SIG_HOLD (void (*)(int))3 227 #endif 228 229 #ifndef S_ISTXT 230 #define S_ISTXT S_ISVTX 231 #endif 232 233 #ifndef S_IRWXU 234 #define S_IRWXU 0000700 /* RWX mask for owner */ 235 #define S_IRWXG 0000070 /* RWX mask for group */ 236 #define S_IRWXO 0000007 /* RWX mask for other */ 237 #endif 238