1 /* $NetBSD: l_stdlib.h,v 1.2 2003/12/04 16:23:36 drochner Exp $ */
4 * Proto types for machines that are not ANSI and POSIX compliant.
19 #if defined(__STDC__) || defined(HAVE_STDARG_H)
25 #ifdef HAVE_SYS_TYPES_H
26 # include <sys/types.h>
29 /* Needed for speed_t. */
38 #include "ntp_types.h"
39 #include "ntp_proto.h"
41 /* Let's try to keep this more or less alphabetized... */
45 extern int adjtime
P((struct timeval
*, struct timeval
*));
50 extern void bcopy
P((const char *, char *, int));
56 extern void bzero
P((char *, int));
60 #ifdef DECL_CFSETISPEED_0
62 extern int cfsetispeed
P((struct termios
*, speed_t
));
63 extern int cfsetospeed
P((struct termios
*, speed_t
));
66 extern char * getpass
P((const char *));
68 #ifdef DECL_HSTRERROR_0
69 extern const char * hstrerror
P((int));
72 #ifdef DECL_INET_NTOA_0
74 extern char * inet_ntoa
P((struct in_addr
));
78 extern int ioctl
P((int, u_long
, char *));
83 extern int bind
P((int, struct sockaddr
*, int));
84 extern int connect
P((int, struct sockaddr
*, int));
85 extern int recv
P((int, char *, int, int));
86 extern int recvfrom
P((int, char *, int, int, struct sockaddr
*, int *));
87 extern int send
P((int, char *, int, int));
88 extern int sendto
P((int, char *, int, int, struct sockaddr
*, int));
89 extern int setsockopt
P((int, int, int, char *, int));
90 extern int socket
P((int, int, int));
94 extern void * memmove
P((void *, const void *, size_t));
98 extern char * memset
P((char *, int, int));
101 #ifdef DECL_MKSTEMP_0
102 extern int mkstemp
P((char *));
106 extern char *mktemp
P((char *));
111 extern int nlist
P((const char *, struct nlist
*));
115 extern int plock
P((int));
119 extern int rename
P((const char *, const char *));
124 extern int select
P((int, fd_set
*, fd_set
*, fd_set
*, struct timeval
*));
128 #ifdef DECL_SETITIMER_0
130 extern int setitimer
P((int , struct itimerval
*, struct itimerval
*));
134 #ifdef DECL_SETPRIORITY_0
135 extern int setpriority
P((int, int, int));
137 #ifdef DECL_SETPRIORITY_1
138 extern int setpriority
P((int, id_t
, int));
144 extern int sigvec
P((int, struct sigvec
*, struct sigvec
*));
147 #ifndef HAVE_SNPRINTF
149 extern int snprintf
P((char *, size_t, const char *, ...));
152 /* HMS: does this need further protection? */
153 #ifndef HAVE_VSNPRINTF
154 extern int vsnprintf
P((char *, size_t, const char *, va_list));
158 #if defined(FILE) || defined(BUFSIZ)
159 extern int _flsbuf
P((int, FILE *));
160 extern int _filbuf
P((FILE *));
161 extern int fclose
P((FILE *));
162 extern int fflush
P((FILE *));
163 extern int fprintf
P((FILE *, const char *, ...));
164 extern int fscanf
P((FILE *, const char *, ...));
165 extern int fputs
P((const char *, FILE *));
166 extern int fputc
P((int, FILE *));
167 extern int fread
P((char *, int, int, FILE *));
168 extern void perror
P((const char *));
169 extern int printf
P((const char *, ...));
170 extern int setbuf
P((FILE *, char *));
171 # ifdef HAVE_SETLINEBUF
172 extern int setlinebuf
P((FILE *));
174 extern int setvbuf
P((FILE *, char *, int, int));
175 extern int scanf
P((const char *, ...));
176 extern int sscanf
P((const char *, const char *, ...));
177 extern int vfprintf
P((FILE *, const char *, ...));
178 extern int vsprintf
P((char *, const char *, ...));
183 extern int stime
P((const time_t *));
187 extern int stime
P((long *));
190 #ifdef DECL_STRERROR_0
191 extern char * strerror
P((int errnum
));
195 extern long strtol
P((const char *, char **, int));
199 extern int syscall
P((int, ...));
203 extern void closelog
P((void));
205 extern void openlog
P((const char *, int));
207 extern void openlog
P((const char *, int, int));
209 extern int setlogmask
P((int));
210 extern void syslog
P((int, const char *, ...));
214 extern time_t time
P((time_t *));
217 #ifdef DECL_TIMEOFDAY_0
218 #ifdef SYSV_TIMEOFDAY
219 extern int gettimeofday
P((struct timeval
*));
220 extern int settimeofday
P((struct timeval
*));
221 #else /* not SYSV_TIMEOFDAY */
223 extern int gettimeofday
P((struct timeval
*, struct timezone
*));
224 extern int settimeofday
P((struct timeval
*, void *));
225 #endif /* not SYSV_TIMEOFDAY */
228 #ifdef DECL_TOLOWER_0
229 extern int tolower
P((int));
232 #ifdef DECL_TOUPPER_0
233 extern int toupper
P((int));
237 * Necessary variable declarations.
243 #if defined(DECL_H_ERRNO) && !defined(h_errno)
247 /*******************************************************/
251 * Unprotoyped library functions for SunOS 4.x.x
254 extern void closelog
P((void));
255 extern void openlog
P((char *, int, int));
256 extern void syslog
P((int, char *, ...));
257 extern int setlogmask
P((int));
259 extern char * getpass
P((char *));
261 extern int setpriority
P((int ,int ,int));
263 extern long strtol
P((char *, char **, int));
265 #if !defined(NTP_POSIX_SOURCE)
266 extern int atoi
P((char *));
267 extern int dup2
P((int, int));
268 extern int execve
P((char *, char **,char **));
269 extern int fork
P((void));
270 extern int getdtablesize
P((void));
271 extern int qsort (void *, int , int,
272 int P((*compar
)(void *, void *)));
273 extern int setpgrp
P((int, int));
274 extern void bcopy
P((const char *, char *, int));
277 #ifndef bzero /* XXX macro prototyping clash */
278 extern void bzero
P((char *, int));
279 extern int bcmp
P((char *, char *, int));
280 extern void bcopy
P((const char *, char *, int));
282 extern char *mktemp
P((char *));
284 extern int tolower
P((int));
286 extern int isatty
P((int));
288 extern unsigned sleep
P((unsigned ));
289 extern unsigned int alarm
P((unsigned int));
290 extern int pause
P((void));
292 extern int getpid
P((void));
293 extern int getppid
P((void));
295 extern int close
P((int));
296 extern int ioctl
P((int, int, char *));
297 extern int rename
P((char *, char *));
299 extern int read
P((int, void *, size_t));
300 extern int write
P((int, const void *, size_t));
302 extern int unlink
P((const char *));
303 extern int link
P((const char *, const char *));
306 extern int fclose
P((FILE *));
307 extern int fflush
P((FILE *));
308 extern int fprintf
P((FILE *, char *, ...));
309 extern int fscanf
P((FILE *, char *, ...));
310 extern int fputs
P((char *, FILE *));
311 extern int fputc
P((char, FILE *));
312 extern int fread
P((char *, int, int, FILE *));
313 extern int printf
P((char *, ...));
314 extern int setbuf
P((FILE *, char *));
315 extern int setvbuf
P((FILE *, char *, int, int));
316 extern int scanf
P((char *, ...));
317 extern int sscanf
P((char *, char *, ...));
318 extern int vsprintf
P((char *, char *, ...));
319 extern int _flsbuf
P((int, FILE *));
320 extern int _filbuf
P((FILE *));
321 extern void perror
P((char *));
322 #ifdef HAVE_SETLINEBUF
323 extern int setlinebuf
P((FILE *));
328 #ifdef NTP_POSIX_SOURCE /* these are builtins */
329 #ifndef NTP_NEED_BOPS /* but may be emulated by bops */
330 extern char *memcpy
P(());
331 extern char *memset
P(());
332 extern int memcmp
P(());
338 extern int bind
P((int, struct sockaddr
*, int));
339 extern int connect
P((int, struct sockaddr
*, int));
340 extern int sendto
P((int, char *, int, int, struct sockaddr
*, int));
341 extern int setsockopt
P((int, int, int, char *, int));
342 extern int socket
P((int, int, int));
343 extern int recvfrom
P((int, char *, int, int, struct sockaddr
*, int *));
344 #endif /* _sys_socket_h */
347 extern int select
P((int, fd_set
*, fd_set
*, fd_set
*, struct timeval
*));
351 extern int adjtime
P((struct timeval
*, struct timeval
*));
352 extern int setitimer
P((int , struct itimerval
*, struct itimerval
*));
353 #ifdef SYSV_TIMEOFDAY
354 extern int gettimeofday
P((struct timeval
*));
355 extern int settimeofday
P((struct timeval
*));
356 #else /* ! SYSV_TIMEOFDAY */
357 extern int gettimeofday
P((struct timeval
*, struct timezone
*));
358 extern int settimeofday
P((struct timeval
*, struct timezone
*));
359 #endif /* SYSV_TIMEOFDAY */
360 #endif /* _sys_time_h */
363 extern time_t time
P((time_t *));
367 extern int setjmp
P((jmp_buf));
368 extern void longjmp
P((jmp_buf, int));
371 #ifdef _sys_resource_h
372 extern int getrusage
P((int, struct rusage
*));
376 extern int nlist
P((char *, struct nlist
*));
379 #endif /* SYS_SUNOS4 */
382 * Unprototyped library functions for DEC OSF/1
385 #ifndef _MACHINE_ENDIAN_H_
386 #define _MACHINE_ENDIAN_H_
387 extern u_short htons
P((u_short
));
388 extern u_short ntohs
P((u_short
));
389 extern u_int32 htonl
P((u_int32
));
390 extern u_int32 ntohl
P((u_int32
));
391 #endif /* _MACHINE_ENDIAN_H_ */
394 extern char * getpass P((char *));
396 extern char * mktemp
P((char *));
398 extern int ioctl
P((int, u_long
, char *));
399 extern void bzero
P((char *, int));
403 extern int bind
P((int, const struct sockaddr
*, int));
404 extern int connect
P((int, const struct sockaddr
*, int));
405 extern int socket
P((int, int, int));
406 extern int sendto
P((int, const void *, int, int, const struct sockaddr
*, int));
407 extern int setsockopt
P((int, int, int, const void *, int));
408 extern int recvfrom
P((int, void *, int, int, struct sockaddr
*, int *));
409 #endif /* SOCK_STREAM */
412 extern int select
P((int, fd_set
*, fd_set
*, fd_set
*, struct timeval
*));
418 * Unprototyped library functions for Ultrix
421 extern int close
P((int));
422 extern char * getpass
P((char *));
423 extern int getpid
P((void));
424 extern int ioctl
P((int, int, char *));
425 extern char *mktemp
P((char *));
426 extern int unlink
P((const char *));
427 extern int link
P((const char *, const char *));
429 extern void closelog
P((void));
430 extern void syslog
P((int, char *, ...));
432 extern void openlog
P((char *, int));
434 extern void openlog
P((char *, int, int));
437 extern int setpriority
P((int ,int ,int ));
440 extern int bind
P((int, struct sockaddr
*, int));
441 extern int connect
P((int, struct sockaddr
*, int));
442 extern int socket
P((int, int, int));
443 extern int sendto
P((int, char *, int, int, struct sockaddr
*, int));
444 extern int setsockopt
P((int, int, int, char *, int));
445 extern int recvfrom
P((int, char *, int, int, struct sockaddr
*, int *));
446 #endif /* SOCK_STREAM */
449 extern int gettimeofday
P((struct timeval
*, struct timezone
*));
450 extern int settimeofday
P((struct timeval
*, struct timezone
*));
451 extern int adjtime
P((struct timeval
*, struct timeval
*));
452 extern int select
P((int, fd_set
*, fd_set
*, fd_set
*, struct timeval
*));
453 extern int setitimer
P((int , struct itimerval
*, struct itimerval
*));
454 #endif /* _TIME_H_ */
457 extern int nlist
P((char *, struct nlist
*));
460 #ifndef bzero /* XXX macro prototyping clash */
461 extern void bzero
P((char *, int));
462 extern int bcmp
P((char *, char *, int));
463 extern void bcopy
P((const char *, char *, int));
466 #ifndef NTP_POSIX_SOURCE
467 extern int atoi
P((char *));
468 extern void bzero
P((char *, int));
469 extern int bcmp
P((char *, char *, int));
470 extern void bcopy
P((const char *, char *, int));
471 extern int execve
P((char *, char **,char **));
472 extern int fork
P((void));
473 extern int getdtablesize
P((void));
474 extern int ran
P((void));
476 extern int gettimeofday
P((struct timeval
*, struct timezone
*));
477 extern int settimeofday
P((struct timeval
*, struct timezone
*));
482 extern int getrusage
P((int, struct rusage
*));
485 #endif /* SYS_ULTRIX */
487 #if defined(__convex__)
488 extern char * getpass
P((char *));
492 extern char * getpass
P((char *));
496 extern char * getpass
P((char *));
500 extern char * getpass
P((char *));
501 #endif /* SYS_DOMAINOS */
504 #define IN_CLASSD(i) (((long)(i) & 0xf0000000) == 0xe0000000)
508 #endif /* l_stdlib_h */