os-sunos4.h revision 17680
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 30int _filbuf(FILE *); 31int _flsbuf(u_char, FILE *); 32int fclose(FILE *); 33int fflush(FILE *); 34int fgetc(FILE *); 35int fprintf(FILE *, const char *, ...); 36int fputc(int, FILE *); 37int fputs(const char *, FILE *); 38u_int fread(void *, u_int, u_int, FILE *); 39int fseek(FILE *, long, int); 40u_int fwrite(const void *, u_int, u_int, FILE *); 41int pclose(FILE *); 42void rewind(FILE *); 43void setbuf(FILE *, char *); 44int setlinebuf(FILE *); 45int ungetc(int, FILE *); 46int vfprintf(FILE *, const char *, ...); 47int vprintf(const char *, ...); 48#endif 49 50#if __GNUC__ <= 1 51int read(int, char *, u_int); 52int write(int, char *, u_int); 53#endif 54 55long a64l(const char *); 56#ifdef __STDC__ 57struct sockaddr; 58#endif 59int accept(int, struct sockaddr *, int *); 60int bind(int, struct sockaddr *, int); 61int bcmp(const void *, const void *, u_int); 62void bcopy(const void *, void *, u_int); 63void bzero(void *, int); 64int chroot(const char *); 65int close(int); 66void closelog(void); 67int connect(int, struct sockaddr *, int); 68char *crypt(const char *, const char *); 69int daemon(int, int); 70int fchmod(int, int); 71int fchown(int, int, int); 72void endgrent(void); 73void endpwent(void); 74void endservent(void); 75#ifdef __STDC__ 76struct ether_addr; 77#endif 78struct ether_addr *ether_aton(const char *); 79int flock(int, int); 80#ifdef __STDC__ 81struct stat; 82#endif 83int fstat(int, struct stat *); 84#ifdef __STDC__ 85struct statfs; 86#endif 87int fstatfs(int, struct statfs *); 88int fsync(int); 89#ifdef __STDC__ 90struct timeb; 91#endif 92int ftime(struct timeb *); 93int ftruncate(int, off_t); 94int getdtablesize(void); 95long gethostid(void); 96int gethostname(char *, int); 97int getopt(int, char * const *, const char *); 98int getpagesize(void); 99char *getpass(char *); 100int getpeername(int, struct sockaddr *, int *); 101int getpriority(int, int); 102#ifdef __STDC__ 103struct rlimit; 104#endif 105int getrlimit(int, struct rlimit *); 106int getsockname(int, struct sockaddr *, int *); 107int getsockopt(int, int, int, char *, int *); 108#ifdef __STDC__ 109struct timeval; 110struct timezone; 111#endif 112int gettimeofday(struct timeval *, struct timezone *); 113char *getusershell(void); 114char *getwd(char *); 115int initgroups(const char *, int); 116int ioctl(int, int, caddr_t); 117int iruserok(u_long, int, char *, char *); 118int isatty(int); 119int killpg(int, int); 120int listen(int, int); 121#ifdef __STDC__ 122struct utmp; 123#endif 124void login(struct utmp *); 125int logout(const char *); 126off_t lseek(int, off_t, int); 127int lstat(const char *, struct stat *); 128int mkstemp(char *); 129char *mktemp(char *); 130int munmap(caddr_t, int); 131void openlog(const char *, int, int); 132void perror(const char *); 133int printf(const char *, ...); 134int puts(const char *); 135long random(void); 136int readlink(const char *, char *, int); 137#ifdef __STDC__ 138struct iovec; 139#endif 140int readv(int, struct iovec *, int); 141int recv(int, char *, u_int, int); 142int recvfrom(int, char *, u_int, int, struct sockaddr *, int *); 143int rename(const char *, const char *); 144int rcmd(char **, u_short, char *, char *, char *, int *); 145int rresvport(int *); 146int send(int, char *, u_int, int); 147int sendto(int, char *, u_int, int, struct sockaddr *, int); 148int setenv(const char *, const char *, int); 149int seteuid(int); 150int setpriority(int, int, int); 151int select(int, fd_set *, fd_set *, fd_set *, struct timeval *); 152int setpgrp(int, int); 153void setpwent(void); 154int setrlimit(int, struct rlimit *); 155void setservent(int); 156int setsockopt(int, int, int, char *, int); 157int shutdown(int, int); 158int sigblock(int); 159void (*signal (int, void (*) (int))) (int); 160int sigpause(int); 161int sigsetmask(int); 162#ifdef __STDC__ 163struct sigvec; 164#endif 165int sigvec(int, struct sigvec *, struct sigvec*); 166int snprintf(char *, size_t, const char *, ...); 167int socket(int, int, int); 168int socketpair(int, int, int, int *); 169int symlink(const char *, const char *); 170void srandom(int); 171int sscanf(char *, const char *, ...); 172int stat(const char *, struct stat *); 173int statfs(char *, struct statfs *); 174char *strerror(int); 175int strcasecmp(const char *, const char *); 176#ifdef __STDC__ 177struct tm; 178#endif 179int strftime(char *, int, char *, struct tm *); 180int strncasecmp(const char *, const char *, int); 181long strtol(const char *, char **, int); 182void sync(void); 183void syslog(int, const char *, ...); 184int system(const char *); 185long tell(int); 186time_t time(time_t *); 187char *timezone(int, int); 188int tolower(int); 189int toupper(int); 190int truncate(char *, off_t); 191void unsetenv(const char *); 192int vfork(void); 193int vsprintf(char *, const char *, ...); 194int writev(int, struct iovec *, int); 195#ifdef __STDC__ 196struct rusage; 197#endif 198int utimes(const char *, struct timeval *); 199#if __GNUC__ <= 1 200int wait(int *); 201pid_t wait3(int *, int, struct rusage *); 202#endif 203 204extern int opterr, optind, optopt; 205extern 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