2 * Copyright (c) 1989, 1990, 1993, 1994, 1995, 1996
3 * The Regents of the University of California. All rights reserved.
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
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.
21 * @(#) $Header: os-sunos4.h,v 1.31 96/06/24 02:39:07 leres Exp $ (LBL)
26 #define WAITSTATUS int
28 /* Prototypes missing in SunOS 4 */
31 int _flsbuf(u_char, 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 *);
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 *, ...);
51 int read(int, char *, u_int);
52 int write(int, char *, u_int);
55 long a64l(const char *);
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 *);
67 int connect(int, struct sockaddr *, int);
68 char *crypt(const char *, const char *);
71 int fchown(int, int, int);
74 void endservent(void);
78 struct ether_addr *ether_aton(const char *);
83 int fstat(int, struct stat *);
87 int fstatfs(int, struct statfs *);
92 int ftime(struct timeb *);
93 int ftruncate(int, off_t);
94 int getdtablesize(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);
105 int getrlimit(int, struct rlimit *);
106 int getsockname(int, struct sockaddr *, int *);
107 int getsockopt(int, int, int, char *, int *);
112 int gettimeofday(struct timeval *, struct timezone *);
113 char *getusershell(void);
115 int initgroups(const char *, int);
116 int ioctl(int, int, caddr_t);
117 int iruserok(u_long, int, char *, char *);
119 int killpg(int, int);
120 int listen(int, int);
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 *);
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 *);
136 int readlink(const char *, char *, int);
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);
150 int setpriority(int, int, int);
151 int select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
152 int setpgrp(int, int);
154 int setrlimit(int, struct rlimit *);
155 void setservent(int);
156 int setsockopt(int, int, int, char *, int);
157 int shutdown(int, int);
159 void (*signal (int, void (*) (int))) (int);
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 *);
171 int sscanf(char *, const char *, ...);
172 int stat(const char *, struct stat *);
173 int statfs(char *, struct statfs *);
175 int strcasecmp(const char *, const char *);
179 int strftime(char *, int, char *, struct tm *);
180 int strncasecmp(const char *, const char *, int);
181 long strtol(const char *, char **, int);
183 void syslog(int, const char *, ...);
184 int system(const char *);
186 time_t time(time_t *);
187 char *timezone(int, int);
190 int truncate(char *, off_t);
191 void unsetenv(const char *);
193 int vsprintf(char *, const char *, ...);
194 int writev(int, struct iovec *, int);
198 int utimes(const char *, struct timeval *);
201 pid_t wait3(int *, int, struct rusage *);
204 extern int opterr, optind, optopt;
207 /* Map protocol types */
208 #define ETHERPUP_IPTYPE ETHERTYPE_IP
209 #define ETHERPUP_REVARPTYPE ETHERTYPE_REVARP
210 #define ETHERPUP_ARPTYPE ETHERTYPE_ARP
212 /* Ugly signal hacking */
215 #define SIG_ERR (void (*)(int))-1
217 #define SIG_DFL (void (*)(int))0
219 #define SIG_IGN (void (*)(int))1
223 #define SIG_CATCH (void (*)(int))2
226 #define SIG_HOLD (void (*)(int))3
230 #define S_ISTXT S_ISVTX
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 */