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
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
|
/*
* Proto types for machines that are not ANSI and POSIX compliant.
* This is optional
*/
#ifndef _l_stdlib_h
#define _l_stdlib_h
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifdef HAVE_STDLIB_H
# include <stdlib.h>
#endif
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
/* Needed for speed_t. */
#ifdef HAVE_TERMIOS_H
# include <termios.h>
#endif
#ifdef HAVE_ERRNO_H
# include <errno.h>
#endif
#include "ntp_types.h"
#include "ntp_proto.h"
/* Let's try to keep this more or less alphabetized... */
#ifdef DECL_ADJTIME_0
struct timeval;
extern int adjtime P((struct timeval *, struct timeval *));
#endif
#ifdef DECL_BCOPY_0
#ifndef bcopy
extern void bcopy P((const char *, char *, int));
#endif
#endif
#ifdef DECL_BZERO_0
#ifndef bzero
extern void bzero P((char *, int));
#endif
#endif
#ifdef DECL_CFSETISPEED_0
struct termios;
extern int cfsetispeed P((struct termios *, speed_t));
extern int cfsetospeed P((struct termios *, speed_t));
#endif
extern char * getpass P((const char *));
#ifdef DECL_INET_NTOA_0
struct in_addr;
extern char * inet_ntoa P((struct in_addr));
#endif
#ifdef DECL_IOCTL_0
extern int ioctl P((int, u_long, char *));
#endif
#ifdef DECL_IPC_0
struct sockaddr;
extern int bind P((int, struct sockaddr *, int));
extern int connect P((int, struct sockaddr *, int));
extern int recv P((int, char *, int, int));
extern int recvfrom P((int, char *, int, int, struct sockaddr *, int *));
extern int send P((int, char *, int, int));
extern int sendto P((int, char *, int, int, struct sockaddr *, int));
extern int setsockopt P((int, int, int, char *, int));
extern int socket P((int, int, int));
#endif
#ifdef DECL_MEMMOVE_0
extern void * memmove P((void *, const void *, size_t));
#endif
#ifdef DECL_MEMSET_0
extern char * memset P((char *, int, int));
#endif
#ifdef DECL_MKSTEMP_0
extern int mkstemp P((char *));
#endif
#ifdef DECL_MKTEMP_0
extern char *mktemp P((char *));
#endif
#ifdef DECL_MRAND48_0
extern long mrand48 P((void));
#endif
#ifdef DECL_NLIST_0
struct nlist;
extern int nlist P((const char *, struct nlist *));
#endif
#ifdef DECL_PLOCK_0
extern int plock P((int));
#endif
#ifdef DECL_RENAME_0
extern int rename P((const char *, const char *));
#endif
#ifdef DECL_SELECT_0
#ifdef _ntp_select_h
extern int select P((int, fd_set *, fd_set *, fd_set *, struct timeval *));
#endif
#endif
#ifdef DECL_SETITIMER_0
struct itimerval;
extern int setitimer P((int , struct itimerval *, struct itimerval *));
#endif
#ifdef PRIO_PROCESS
#ifdef DECL_SETPRIORITY_0
extern int setpriority P((int, int, int));
#endif
#ifdef DECL_SETPRIORITY_1
extern int setpriority P((int, id_t, int));
#endif
#endif
#ifdef DECL_SIGVEC_0
struct sigvec;
extern int sigvec P((int, struct sigvec *, struct sigvec *));
#endif
#ifdef DECL_SRAND48_0
extern void srand48 P((long));
#endif
#ifdef DECL_STDIO_0
#if defined(FILE) || defined(BUFSIZ)
extern int _flsbuf P((int, FILE *));
extern int _filbuf P((FILE *));
extern int fclose P((FILE *));
extern int fflush P((FILE *));
extern int fprintf P((FILE *, const char *, ...));
extern int fscanf P((FILE *, const char *, ...));
extern int fputs P((const char *, FILE *));
extern int fputc P((int, FILE *));
extern int fread P((char *, int, int, FILE *));
extern void perror P((const char *));
extern int printf P((const char *, ...));
extern int setbuf P((FILE *, char *));
# ifdef HAVE_SETLINEBUF
extern int setlinebuf P((FILE *));
# endif
extern int setvbuf P((FILE *, char *, int, int));
extern int scanf P((const char *, ...));
extern int sscanf P((const char *, const char *, ...));
extern int vfprintf P((FILE *, const char *, ...));
extern int vsprintf P((char *, const char *, ...));
#endif
#endif
#ifdef DECL_STIME_0
extern int stime P((const time_t *));
#endif
#ifdef DECL_STIME_1
extern int stime P((long *));
#endif
#ifdef DECL_STRERROR_0
extern char * strerror P((int errnum));
#endif
#ifdef DECL_STRTOL_0
extern long strtol P((const char *, char **, int));
#endif
#ifdef DECL_SYSCALL
extern int syscall P((int, ...));
#endif
#ifdef DECL_SYSLOG_0
extern void closelog P((void));
#ifndef LOG_DAEMON
extern void openlog P((const char *, int));
#else
extern void openlog P((const char *, int, int));
#endif
extern int setlogmask P((int));
extern void syslog P((int, const char *, ...));
#endif
#ifdef DECL_TIME_0
extern time_t time P((time_t *));
#endif
#ifdef DECL_TIMEOFDAY_0
#ifdef SYSV_TIMEOFDAY
extern int gettimeofday P((struct timeval *));
extern int settimeofday P((struct timeval *));
#else /* not SYSV_TIMEOFDAY */
struct timezone;
extern int gettimeofday P((struct timeval *, struct timezone *));
extern int settimeofday P((struct timeval *, void *));
#endif /* not SYSV_TIMEOFDAY */
#endif
#ifdef DECL_TOLOWER_0
extern int tolower P((int));
#endif
#ifdef DECL_TOUPPER_0
extern int toupper P((int));
#endif
/*
* Necessary variable declarations.
*/
#ifdef DECL_ERRNO
extern int errno;
#endif
#ifdef DECL_H_ERRNO
extern int h_errno;
#endif
/*******************************************************/
#if 0
/*
* Unprotoyped library functions for SunOS 4.x.x
*/
#ifdef SYS_SUNOS4
extern void closelog P((void));
extern void openlog P((char *, int, int));
extern void syslog P((int, char *, ...));
extern int setlogmask P((int));
extern char * getpass P((char *));
extern int setpriority P((int ,int ,int));
extern long strtol P((char *, char **, int));
#if !defined(NTP_POSIX_SOURCE)
extern int atoi P((char *));
extern int dup2 P((int, int));
extern int execve P((char *, char **,char **));
extern int fork P((void));
extern int getdtablesize P((void));
extern int qsort (void *, int , int,
int P((*compar)(void *, void *)));
extern long random P((void));
extern long mrand48 P((void));
extern int setpgrp P((int, int));
extern void srandom P((unsigned int));
extern void bcopy P((const char *, char *, int));
#endif
#ifndef bzero /* XXX macro prototyping clash */
extern void bzero P((char *, int));
extern int bcmp P((char *, char *, int));
extern void bcopy P((const char *, char *, int));
#endif
extern char *mktemp P((char *));
extern int tolower P((int));
extern int isatty P((int));
extern unsigned sleep P((unsigned ));
extern unsigned int alarm P((unsigned int));
extern int pause P((void));
extern int getpid P((void));
extern int getppid P((void));
extern int close P((int));
extern int ioctl P((int, int, char *));
extern int rename P((char *, char *));
#if 0
extern int read P((int, void *, size_t));
extern int write P((int, const void *, size_t));
#endif
extern int unlink P((const char *));
extern int link P((const char *, const char *));
#ifdef FILE
extern int fclose P((FILE *));
extern int fflush P((FILE *));
extern int fprintf P((FILE *, char *, ...));
extern int fscanf P((FILE *, char *, ...));
extern int fputs P((char *, FILE *));
extern int fputc P((char, FILE *));
extern int fread P((char *, int, int, FILE *));
extern int printf P((char *, ...));
extern int setbuf P((FILE *, char *));
extern int setvbuf P((FILE *, char *, int, int));
extern int scanf P((char *, ...));
extern int sscanf P((char *, char *, ...));
extern int vsprintf P((char *, char *, ...));
extern int _flsbuf P((int, FILE *));
extern int _filbuf P((FILE *));
extern void perror P((char *));
#ifdef HAVE_SETLINEBUF
extern int setlinebuf P((FILE *));
#endif
#endif
#ifdef _ntp_string_h
#ifdef NTP_POSIX_SOURCE /* these are builtins */
#ifndef NTP_NEED_BOPS /* but may be emulated by bops */
extern char *memcpy P(());
extern char *memset P(());
extern int memcmp P(());
#endif
#endif
#endif
#ifdef _sys_socket_h
extern int bind P((int, struct sockaddr *, int));
extern int connect P((int, struct sockaddr *, int));
extern int sendto P((int, char *, int, int, struct sockaddr *, int));
extern int setsockopt P((int, int, int, char *, int));
extern int socket P((int, int, int));
extern int recvfrom P((int, char *, int, int, struct sockaddr *, int *));
#endif /* _sys_socket_h */
#ifdef _ntp_select_h
extern int select P((int, fd_set *, fd_set *, fd_set *, struct timeval *));
#endif
#ifdef _sys_time_h
extern int adjtime P((struct timeval *, struct timeval *));
extern int setitimer P((int , struct itimerval *, struct itimerval *));
#ifdef SYSV_TIMEOFDAY
extern int gettimeofday P((struct timeval *));
extern int settimeofday P((struct timeval *));
#else /* ! SYSV_TIMEOFDAY */
extern int gettimeofday P((struct timeval *, struct timezone *));
extern int settimeofday P((struct timeval *, struct timezone *));
#endif /* SYSV_TIMEOFDAY */
#endif /* _sys_time_h */
#ifdef __time_h
extern time_t time P((time_t *));
#endif
#ifdef __setjmp_h
extern int setjmp P((jmp_buf));
extern void longjmp P((jmp_buf, int));
#endif
#ifdef _sys_resource_h
extern int getrusage P((int, struct rusage *));
#endif
#ifdef _nlist_h
extern int nlist P((char *, struct nlist *));
#endif
#endif /* SYS_SUNOS4 */
/*
* Unprototyped library functions for DEC OSF/1
*/
#ifdef SYS_DECOSF1
#ifndef _MACHINE_ENDIAN_H_
#define _MACHINE_ENDIAN_H_
extern u_short htons P((u_short));
extern u_short ntohs P((u_short));
extern u_int32 htonl P((u_int32));
extern u_int32 ntohl P((u_int32));
#endif /* _MACHINE_ENDIAN_H_ */
/*
extern char * getpass P((char *));
*/
extern char * mktemp P((char *));
#ifndef SYS_IX86OSF1
extern int ioctl P((int, u_long, char *));
extern void bzero P((char *, int));
#endif
#ifdef SOCK_DGRAM
extern int bind P((int, const struct sockaddr *, int));
extern int connect P((int, const struct sockaddr *, int));
extern int socket P((int, int, int));
extern int sendto P((int, const void *, int, int, const struct sockaddr *, int));
extern int setsockopt P((int, int, int, const void *, int));
extern int recvfrom P((int, void *, int, int, struct sockaddr *, int *));
#endif /* SOCK_STREAM */
#ifdef _ntp_select_h
extern int select P((int, fd_set *, fd_set *, fd_set *, struct timeval *));
#endif
#endif /* DECOSF1 */
/*
* Unprototyped library functions for Ultrix
*/
#ifdef SYS_ULTRIX
extern int close P((int));
extern char * getpass P((char *));
extern int getpid P((void));
extern int ioctl P((int, int, char *));
extern char *mktemp P((char *));
extern int unlink P((const char *));
extern int link P((const char *, const char *));
extern void closelog P((void));
extern void syslog P((int, char *, ...));
#ifndef LOG_DAEMON
extern void openlog P((char *, int));
#else
extern void openlog P((char *, int, int));
#endif
extern int setpriority P((int ,int ,int ));
#ifdef SOCK_DGRAM
extern int bind P((int, struct sockaddr *, int));
extern int connect P((int, struct sockaddr *, int));
extern int socket P((int, int, int));
extern int sendto P((int, char *, int, int, struct sockaddr *, int));
extern int setsockopt P((int, int, int, char *, int));
extern int recvfrom P((int, char *, int, int, struct sockaddr *, int *));
#endif /* SOCK_STREAM */
#ifdef _TIME_H_
extern int gettimeofday P((struct timeval *, struct timezone *));
extern int settimeofday P((struct timeval *, struct timezone *));
extern int adjtime P((struct timeval *, struct timeval *));
extern int select P((int, fd_set *, fd_set *, fd_set *, struct timeval *));
extern int setitimer P((int , struct itimerval *, struct itimerval *));
#endif /* _TIME_H_ */
#ifdef N_UNDF
extern int nlist P((char *, struct nlist *));
#endif
#ifndef bzero /* XXX macro prototyping clash */
extern void bzero P((char *, int));
extern int bcmp P((char *, char *, int));
extern void bcopy P((const char *, char *, int));
#endif
#ifndef NTP_POSIX_SOURCE
extern int atoi P((char *));
extern void bzero P((char *, int));
extern int bcmp P((char *, char *, int));
extern void bcopy P((const char *, char *, int));
extern int execve P((char *, char **,char **));
extern int fork P((void));
extern int getdtablesize P((void));
extern int ran P((void));
extern int rand P((void));
extern void srand P((unsigned int));
#ifdef _TIME_H_
extern int gettimeofday P((struct timeval *, struct timezone *));
extern int settimeofday P((struct timeval *, struct timezone *));
#endif
#endif
#ifdef _RESOURCE_H_
extern int getrusage P((int, struct rusage *));
#endif
#endif /* SYS_ULTRIX */
#if defined(__convex__)
extern char * getpass P((char *));
#endif
#ifdef SYS_IRIX4
extern char * getpass P((char *));
#endif /* IRIX4 */
#ifdef SYS_VAX
extern char * getpass P((char *));
#endif /* VAX */
#ifdef SYS_DOMAINOS
extern char * getpass P((char *));
#endif /* SYS_DOMAINOS */
#ifdef SYS_BSD
#define IN_CLASSD(i) (((long)(i) & 0xf0000000) == 0xe0000000)
#endif
#endif /* 0 */
#endif /* l_stdlib_h */
|