aboutsummaryrefslogtreecommitdiffstats
path: root/include/sun_stdlib.h
blob: ac6757a95324762fd896225dc9a395feb5e5affa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
/*
 * sun_stdlib.h 95/06/07
 *
 * Copyright 1994, BBW
 *
 */
/*
 * Copyright 1992-1994 Rudolf Koenig.
 * sun_stdlib.h 
 *
 * This header file is redundant/wrong for architectures that have sane 
 * header files. Grrr.
 */
#ifndef __sun_stdlib_h
#define __sun_stdlib_h
#if defined(FILE)

#if !defined(STDIO_WRITE_NOW)

extern int fputs(char *, FILE *);
extern int fseek(FILE *, int, int);
extern int fclose(FILE *);
extern int fread(char *, int, int, FILE *);
extern int fwrite(char *, int, int, FILE *);
extern int fflush(FILE *);
extern int fprintf(FILE *, const char *, ... );
extern void rewind(FILE *);
extern void setvbuf(FILE *stream, char *buf, int type, int size);
extern void setbuffer(FILE *stream, char *buf, int size);

extern int _filbuf( FILE * );
extern int _flsbuf(unsigned char, FILE*);
#else
extern int _fill_buffer_( FILE * );
extern int _flush_buffer_(int, FILE*);
#endif

#endif

extern int puts(char *);

#if !defined(STDIO_WRITE_NOW)
extern int printf( const char *, ... );
#endif


extern int getpid(void);
extern int getppid(void);
extern int pipe(int *);

#if 1
extern char *sprintf( char *, const char *, ... );
extern char *vsprintf( char *, const char *, ... );
#endif
extern int vfork(void);
extern int fork(void);
extern int close(int);
extern int dup(int);

#ifndef __sys_unistd_h /* GNUCC has another imagination about this */
extern int execl(char *, ... );
extern int execv(char *, char *[]);
extern int execle(char *, ... );
extern int execlp(char *, ... );
extern int execvp(char *, char *[]);
extern int setuid(int);
#endif

extern int seteuid(int);

extern int getpgrp(int);
extern int setpgrp(int, int);

extern int gethostname (char *, int);
extern int sethostname (char *, int);

#ifdef _sys_socket_h
extern int getpeername(int, struct sockaddr *, int *);
extern int send(int, char *, int, int);
extern int sendto(int, char *, int, int, struct sockaddr *, int);
extern int recv(int, char *, int, int);
extern int recvfrom(int, char *, int, int, struct sockaddr *, int *);
#endif

#ifdef _sys_vfs_h
extern int statfs(const char *, struct statfs *);
#endif

#ifdef __sys_types_h /* def of caddr_t */
extern time_t time(time_t *);
extern int ioctl(int, int, caddr_t);
extern int truncate(char *, off_t);
extern int ftruncate(int, off_t);
caddr_t mmap(caddr_t, size_t, int, int, int, off_t);
int munmap(caddr_t, int);
#endif
extern void perror(char *);

extern int openlog(char *, int, int);

extern int syslog(int, char *, ... );
extern int closelog(void);
extern int setlogmask(int);

extern unsigned int alarm(unsigned int);

extern char *crypt(char *, char *);
extern char *_crypt(char *, char *);
extern int setkey(char *);
extern int encrypt(char *, int);

extern char *getenv(char *name);
extern int putenv(char *);
extern void bcopy(char *, char *, int);
extern void bzero(char *, int);
extern int bcmp(char *, char *, int);
extern int tolower(int);
extern int toupper(int);

#if !defined(__memory_h__)
extern void memset(char *, int, int);
#if !defined(__GNUC__)
extern char *memcpy(char *, char *, int);
extern int  memcmp(char *, char *, int);
#endif
#endif

extern int ffs(int);

extern int sigblock(int);
extern int sigsetmask(int);
extern int sigpause(int);

extern int unmount(char *name);
extern int umount(char *name);
int mount(char *type, char *dir, int flags, char *data);


#ifdef __sys_stat_h
extern int fchmod(int fd, mode_t mode);
#endif

#ifdef _mntent_h
extern FILE *setmntent(char *filep, char *type);
extern struct mntent *getmntent(FILE *filep);
extern int addmntent(FILE *filep, struct mntent *mnt);
extern char *hasmntopt(struct mntent *mnt, char *opt);
extern int endmntent(FILE *filep);
#endif

#ifdef __pwd_h
extern struct passwd *getpwent(void);
extern void endpwent(void);
#endif


extern int usleep(unsigned);
#if 0
extern int lseek(int, int, int);
#endif

#ifndef __sys_unistd_h /* GNUCC has another imagination about this */
extern int read(int, char *, int);
extern int write(int, char *, int);
extern int sleep(unsigned int);
extern int getuid(void);
extern int geteuid(void);
#endif
extern int fsync(int);

extern int rename(const char *, const char *);
extern int unlink(const char *);
#if defined(__sys_dirent_h)
extern int scandir(char *, struct dirent ***, int (*)(), int (*)());
#else
#if defined(_sys_dir_h)
extern int scandir(char *, struct direct ***, int (*)(), int (*)());
#endif
#endif

#ifndef __stdlib_h
extern int atoi(char *);
extern int qsort(char *, int, int, int (*)());
#endif

extern char *rindex(const char *, const char);
extern char *index(const char *, const char);

#ifndef __string_h /* GNUCC string.h */
extern int strcmp(const char *, const char *);
extern int strncmp(const char *, const char *, int);
extern char *strcat(char *, const char *);
extern char *strdup(const char *);

extern int strcpy(char *, const char *);
extern int strncpy(char *, const char *, int);

extern int strtok(char *, char *);
#endif

extern int strtol(char *, char **, int);

extern int system(char *);
#ifdef RLIMIT_NOFILE
extern int getrlimit(int, struct rlimit *);
extern int setrlimit(int, struct rlimit *);
#endif

extern int chdir(const char *);
#if defined(_sys_time_h) && defined(__sys_types_h)
extern int select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
extern int gettimeofday(struct timeval *tp, struct timezone *tzp);
extern int getitimer(int, struct itimerval *);
extern int setitimer(int, struct itimerval *, struct itimerval *);
#endif
extern char *getpass(char *);
#if !defined(__malloc_h) && !defined(__stdlib_h) /* GNU malloc defs */
extern void *realloc(void *, unsigned);
extern void *calloc(unsigned, unsigned);
extern void *malloc(unsigned);
extern void free(const char *);
#endif

#ifdef SOCK_STREAM
extern int socket(int, int, int);
extern int connect(int, struct sockaddr *, int);
extern int bind(int, struct sockaddr *, int);
extern int getsockname(int, struct sockaddr *, int *);
extern int accept(int, struct sockaddr *, int *);
extern int listen(int, int);
extern int shutdown(int, int);
extern int inet_addr(char *);
extern int getsockopt(int, int, int, char *, int *);
extern int setsockopt(int, int, int, char *, int);

#endif

#ifdef _nettli_tiuser_h
extern int t_open(char *, int, struct t_info *);
extern void t_error(char *);
extern int t_bind(int, struct t_bind *, struct t_bind *);
extern int t_listen(int, struct t_call *);
extern int t_accept(int, int, struct t_call *);
extern int t_rcv(int, char *, unsigned int, int *);
extern int t_snd(int, char *, unsigned int, int);
extern int t_close(int);
extern int t_connect(int, struct t_call *, struct t_call *);
#endif
#ifdef _sys_poll_h
extern int poll(struct pollfd *, unsigned long, int);
#endif

#ifdef _sys_resource_h
int wait3(int *, int, struct rusage *);
#else
int wait3(int *, int, int);
#endif

#ifdef _sys_asynch_h
extern aio_result_t *aiowait(struct timeval *);
extern int aioread(int, char *, int, int, int, aio_result_t *);
extern int aiowrite(int, char *, int, int, int, aio_result_t *);
extern int aiocancel(aio_result_t *);
#endif

extern int on_exit(void (*procp)(), void *arg);

#endif