l_stdlib.h revision 290001
1/*
2 * Proto types for machines that are not ANSI and POSIX	 compliant.
3 * This is optional
4 */
5
6#ifndef L_STDLIB_H
7#define L_STDLIB_H
8
9#ifdef HAVE_STDLIB_H
10# include <stdlib.h>
11#endif
12
13#include <stdarg.h>
14#include <sys/types.h>
15
16/* Needed for speed_t. */
17#ifdef HAVE_TERMIOS_H
18# include <termios.h>
19#endif
20
21#ifdef HAVE_ERRNO_H
22# include <errno.h>
23#endif
24
25#include "ntp_types.h"
26#include "ntp_proto.h"
27
28/* Let's try to keep this more or less alphabetized... */
29
30#ifdef DECL_ADJTIME_0
31struct timeval;
32extern	int	adjtime		(struct timeval *, struct timeval *);
33#endif
34
35#ifdef DECL_BCOPY_0
36#ifndef bcopy
37extern	void	bcopy		(const char *, char *, int);
38#endif
39#endif
40
41#ifdef DECL_BZERO_0
42#ifndef bzero
43extern	void	bzero		(char *, int);
44#endif
45#endif
46
47#ifdef DECL_CFSETISPEED_0
48struct termios;
49extern	int	cfsetispeed	(struct termios *, speed_t);
50extern	int	cfsetospeed	(struct termios *, speed_t);
51#endif
52
53extern	char *	getpass		(const char *);
54
55#ifdef DECL_HSTRERROR_0
56extern	const char * hstrerror	(int);
57#endif
58
59#ifdef DECL_INET_NTOA_0
60struct in_addr;
61extern	char *	inet_ntoa	(struct in_addr);
62#endif
63
64#ifdef DECL_IOCTL_0
65extern	int	ioctl		(int, u_long, char *);
66#endif
67
68#ifdef DECL_IPC_0
69struct sockaddr;
70extern	int	bind		(int, struct sockaddr *, int);
71extern	int	connect		(int, struct sockaddr *, int);
72extern	int	recv		(int, char *, int, int);
73extern	int	recvfrom	(int, char *, int, int, struct sockaddr *, int *);
74extern	int	send		(int, char *, int, int);
75extern	int	sendto		(int, char *, int, int, struct sockaddr *, int);
76extern	int	setsockopt	(int, int, int, char *, int);
77extern	int	socket		(int, int, int);
78#endif
79
80#ifdef DECL_MEMMOVE_0
81extern	void *	memmove		(void *, const void *, size_t);
82#endif
83
84#ifdef DECL_MEMSET_0
85extern	char *	memset		(char *, int, int);
86#endif
87
88#ifdef DECL_MKSTEMP_0
89extern	int	mkstemp		(char *);
90#endif
91
92#ifdef DECL_MKTEMP_0
93extern	char   *mktemp		(char *);
94#endif
95
96#ifdef DECL_NLIST_0
97struct nlist;
98extern int	nlist		(const char *, struct nlist *);
99#endif
100
101#ifdef DECL_PLOCK_0
102extern	int	plock		(int);
103#endif
104
105#ifdef DECL_RENAME_0
106extern	int	rename		(const char *, const char *);
107#endif
108
109#ifdef DECL_SELECT_0
110#ifdef NTP_SELECT_H
111extern	int	select		(int, fd_set *, fd_set *, fd_set *, struct timeval *);
112#endif
113#endif
114
115#ifdef DECL_SETITIMER_0
116struct itimerval;
117extern	int	setitimer	(int , struct itimerval *, struct itimerval *);
118#endif
119
120#ifdef PRIO_PROCESS
121#ifdef DECL_SETPRIORITY_0
122extern	int	setpriority	(int, int, int);
123#endif
124#ifdef DECL_SETPRIORITY_1
125extern	int	setpriority	(int, id_t, int);
126#endif
127#endif
128
129#ifdef DECL_SIGVEC_0
130struct sigvec;
131extern	int	sigvec		(int, struct sigvec *, struct sigvec *);
132#endif
133
134#ifdef DECL_STDIO_0
135#if defined(FILE) || defined(BUFSIZ)
136extern	int	_flsbuf		(int, FILE *);
137extern	int	_filbuf		(FILE *);
138extern	int	fclose		(FILE *);
139extern	int	fflush		(FILE *);
140extern	int	fprintf		(FILE *, const char *, ...);
141extern	int	fscanf		(FILE *, const char *, ...);
142extern	int	fputs		(const char *, FILE *);
143extern	int	fputc		(int, FILE *);
144extern	int	fread		(char *, int, int, FILE *);
145extern	void	perror		(const char *);
146extern	int	printf		(const char *, ...);
147extern	int	setbuf		(FILE *, char *);
148# ifdef HAVE_SETLINEBUF
149extern	int	setlinebuf	(FILE *);
150# endif
151extern	int	setvbuf		(FILE *, char *, int, int);
152extern	int	scanf		(const char *, ...);
153extern	int	sscanf		(const char *, const char *, ...);
154extern	int	vfprintf	(FILE *, const char *, ...);
155extern	int	vsprintf	(char *, const char *, ...);
156#endif
157#endif
158
159#ifdef DECL_STIME_0
160extern	int	stime		(const time_t *);
161#endif
162
163#ifdef DECL_STIME_1
164extern	int	stime		(long *);
165#endif
166
167#ifdef DECL_STRERROR_0
168extern	char *	strerror		(int errnum);
169#endif
170
171#ifdef DECL_STRTOL_0
172extern	long	strtol		(const char *, char **, int);
173#endif
174
175#ifdef DECL_SYSCALL
176extern	int	syscall		(int, ...);
177#endif
178
179#ifdef DECL_SYSLOG_0
180extern	void	closelog	(void);
181#ifndef LOG_DAEMON
182extern	void	openlog		(const char *, int);
183#else
184extern	void	openlog		(const char *, int, int);
185#endif
186extern	int	setlogmask	(int);
187extern	void	syslog		(int, const char *, ...);
188#endif
189
190#ifdef DECL_TIME_0
191extern	time_t	time		(time_t *);
192#endif
193
194#ifdef DECL_TIMEOFDAY_0
195#ifdef SYSV_TIMEOFDAY
196extern	int	gettimeofday	(struct timeval *);
197extern	int	settimeofday	(struct timeval *);
198#else /* not SYSV_TIMEOFDAY */
199struct timezone;
200extern	int	gettimeofday	(struct timeval *, struct timezone *);
201extern	int	settimeofday	(struct timeval *, void *);
202#endif /* not SYSV_TIMEOFDAY */
203#endif
204
205#ifdef DECL_TOLOWER_0
206extern	int	tolower		(int);
207#endif
208
209#ifdef DECL_TOUPPER_0
210extern	int	toupper		(int);
211#endif
212
213/*
214 * Necessary variable declarations.
215 */
216#ifdef DECL_ERRNO
217extern	int	errno;
218#endif
219
220#if defined(DECL_H_ERRNO) && !defined(h_errno)
221extern	int	h_errno;
222#endif
223
224#endif	/* L_STDLIB_H */
225