xref: /original-bsd/old/pcc/lint/llibs/llib-lc (revision 5f5c18da)
1/*	@(#)llib-lc	1.45 (Berkeley) 05/29/89	*/
2
3/* LINTLIBRARY */
4
5#include <sys/types.h>
6#include <sys/time.h>
7
8#include <sys/wait.h>
9#include <sys/dir.h>
10#include <sys/resource.h>
11#include <sys/socket.h>
12#include <sys/stat.h>
13#include <sys/timeb.h>
14#include <sys/times.h>
15#include <sys/uio.h>
16#include <sys/vtimes.h>
17
18#include <netinet/in.h>
19
20#include <netns/ns.h>
21
22#include <arpa/inet.h>
23
24#include <sys/disklabel.h>
25#include <fstab.h>
26#include <grp.h>
27#include <ndbm.h>
28#include <netdb.h>
29#include <nlist.h>
30#include <pwd.h>
31#include <setjmp.h>
32#include <sgtty.h>
33#include <signal.h>
34#include <stdio.h>
35#include <ttyent.h>
36
37	/***	SECTION 2	***/
38int	errno;
39
40int	accept(s, a, l) struct sockaddr *a; int *l; { return s; }
41int	access( p, m) char *p; { return 0; }
42int	acct(f) char *f; { return 0;}
43int	adjtime(delta, odelta) struct timeval *delta, *odelta; { return 0; }
44int	bind(s, n, l) struct sockaddr *n; { return 0; }
45char	*brk(a) char *a; { return(a); }
46int	chdir(s) char *s; { return(0); }
47int	chmod(s, m) char *s; { return(0); }
48int	chown(s, u, g) char *s; { return(0); }
49int	chroot( d ) char *d; { return 0; }
50int	close(f) { return(0); }
51int	connect( s, n, l) struct sockaddr *n; { return 0; }
52int	dup(f) { return(f); }
53int	dup2( o, n) { return o; }
54	execve(s, v, e) char *s, *v[], *e[]; {;}
55	_exit(s) {;}
56int	fchmod(f, m) { return(0); }
57int	fchown(f, u, g) { return(0); }
58int	fcntl(f, c, a) { return (0); }
59int	flock( f, o ) { return 0; }
60int	fork() { return(0); }
61int	fsync( f ) { return 0; }
62int	fstat(f, b) struct stat *b; { return(0); }
63int	ftruncate( d, l) off_t l; { return 0;}
64int	getdtablesize() { return 20 ; }
65gid_t	getegid() { return((gid_t)1); }
66uid_t	geteuid() { return((uid_t)1); }
67gid_t	getgid() { return((gid_t)1); }
68int	getgroups( n, g ) int n, *g; { return 0; }
69long	gethostid() { return 1L; }
70int	gethostname( n, l ) char *n; int l; { return 0 ;}
71int	getitimer( w, v ) struct itimerval *v; { return 0; }
72int	getpagesize() { return 1; }
73int	getpeername(s, n, l) struct sockaddr *n; int *l; { return (0); }
74int	getpgrp(p) { return 1; }
75int	getpid() { return(1); }
76int	getppid() { return(1); }
77int	getpriority( w, who) { return 1;}
78int	getrlimit( res, rip) struct rlimit *rip; { return 0;}
79int	getrusage( res, rip) struct rusage *rip; { return 0;}
80int	getsockname(s, name, namelen) struct sockaddr *name; int *namelen; { return(0); }
81int	getsockopt( s, level, opt, buf, len ) char *buf; int *len; { return 0;}
82int	gettimeofday( t, z ) struct timeval *t; struct timezone *z; { return 0;}
83uid_t	getuid() { return((uid_t)1); }
84int	ioctl( d, r, p) u_long r; char *p; { return 0;}
85int	kill(p, s) { return(0); }
86int	killpg( pg, s) { return 0;}
87int	link(a, b) char *a, *b; { return(0); }
88int	listen( s, b ){ return 0; }
89off_t	lseek(f, o, d) off_t o; { return(o); }
90int	lstat(s, b) char *s; struct stat *b; { return(0); }
91#ifdef notdef
92int	madvise( a, l, b ) char * a; int l, b; { return 0;}
93int	mmap( a, l, p, s, f, o ) char * a; off_t o; { return 0;}
94int	mincore( a, l, v ) char * a; int l; char *v; { return 0; }
95#endif
96int	mkdir( p, m ) char *p; { return 0; }
97int	mknod(n, m, a) char *n; { return(0); }
98int	mount(s, n, f) char *s, *n; { return(0); }
99#ifdef notdef
100int	mprotect( a, l, p) char * a; { return 0;}
101int	mremap( a, l, p, s, f) char * a, f; { return 0;}
102int	munmap( a, l) char * a; { return 0;}
103#endif
104	/* VARARGS2 */
105int	open(f, m, stuff) char *f; { return(0); }
106int	pipe(f) int f[2]; { return(0); }
107	profil(b, s, o, i) char *b; {;}
108int	ptrace(r, p, a, d) int *a; { return(0); }
109int	quota(c, u, a, ad) char *ad; { return(0); }
110int	read(f, b, l) char *b; { return(l); }
111int	readv( d, v, l) struct iovec *v; { return l; }
112int	readlink( p, b, s ) char *p, *b; { return 1; }
113	reboot( h ) {;}
114int	recv( s, b, l, f ) char *b; { return l ; }
115int	recvfrom( s, b, l, f, fr, fl ) char *b; struct sockaddr *fr; int *fl;
116		{ return l; }
117int	recvmsg( s, m, f ) struct msghdr m[]; { return 1; }
118int	rename( f, t ) char *f, *t; { return 0;}
119int	rmdir( p ) char *p; { return 0;}
120char	*sbrk(i) { return((char *)0); }
121int	select( n, r, w, e, t ) fd_set *r, *w, *e; struct timeval *t; { return n; }
122int	send( s, m, l, f )  char *m; { return l; }
123int	sendto( s, m, l, f, t, tl ) char *m; struct sockaddr *t; { return l; }
124int	sendmsg( s, m, l) struct msghdr m[]; { return l; }
125int	setgroups( n, g) int *g; { return 0; }
126int	sethostid( h ) long h; { return 0;}
127int	sethostname( n, l ) char *n; int l; { return 0 ;}
128int	setitimer( w, v, ov ) struct itimerval *v, *ov; { return 0; }
129int	setpgrp( g, pg) { return 0; }
130int	setpriority( w, who, pri ) { return 1;}
131int	setquota(s, f) char *s, *f; { return 0; }
132int	setregid( r, e) int r, e; { return 0; }
133int	setreuid( r, e) int r, e; { return 0; }
134int	setrlimit( res, rip) struct rlimit *rip; { return 0;}
135	/* VARARGS */
136int	setsockopt( s, level, opt, buf, len ) char *buf; { return 0;}
137int	settimeofday( t, z ) struct timeval *t; struct timezone *z; { return 0;}
138int	shutdown( s, h ){ return 0;}
139int	(*signal(c, f))() int (*f)(); { return(f); }
140int	sigvec(c, f, m) struct sigvec *f, *m; { return 0; }
141int	sigblock(m) { return (m); }
142int	sigsetmask(m) { return (m); }
143	sigpause(m) { ; }
144int	sigreturn(scp) struct sigcontext *scp; { return -1; }
145int	sigstack(ss, oss) struct sigstack *ss, *oss; { return 0 ; }
146int	socket( a, t, p) {return 1;}
147int	socketpair( d, t, p, s ) int s[2]; { return 0; }
148int	stat(s, b) char *s; struct stat *b; { return(0); }
149#ifdef notdef
150char *	stk( a ) char * a; { return a; }
151char *	sstk( a ) int a; { return (char *)0; }
152#endif
153int	swapon( s ) char *s; { return 0;}
154int	symlink( t, f) char *t, *f; { return 0;}
155	sync(){;}
156int	truncate( p, l) char *p; off_t l; { return 0;}
157int	umask( n ) { return n; }
158int	umount(s) char *s; { return 0; }
159int	unlink(s) char *s; { return(0); }
160int	utimes( f, t ) char *f; struct timeval t[2]; { return 0 ;}
161int	vfork() { return(0); }
162	vhangup() { ; }
163int	wait(s) union wait *s; { return(1); }
164int	wait3( s, o, r) union wait *s; struct rusage *r; { return 1;}
165int	write(f, b, l) char *b; { return(l); }
166int	writev( f, v, l) struct iovec *v; { return l; }
167
168
169	/***	SECTION 3	***/
170
171struct qelem {	/* this should really be defined in an include file */
172	struct qelem	*q_forw;
173	struct qelem	*q_back;
174	char		data[1];
175}
176
177	/* antique system calls and unclassified */
178	_longjmp( e, v) jmp_buf e; {;}
179int	_setjmp(e) jmp_buf e; { return(0); }
180	abort() {;}
181int	abs(i) int i; { return(i); }
182int	alarm(s) unsigned s; { return(s); }
183	alphasort( d1, d2) struct direct **d1, **d2; { return 0;}
184char *	asctime(t) struct tm *t; { return(""); }
185double	atof(s) char *s; { return(1.); }
186int	atoi(s) char *s; { return 1;   }
187long	atol(s) char *s; { return 1L;   }
188int	bcmp(b1, b2, length) char *b1, *b2; { return 0; }
189	bcopy(src, dst, length) char *src, *dst; { ; }
190	bzero(b, length) char *b; { ; }
191char *	calloc(n,s) unsigned n, s; { static char c[1]; return(c); }
192void	closedir( p ) DIR *p; {}
193	closelog() {}
194int	creat(s, m) char *s; { return(0); }
195char *	crypt(k,s) char *k, *s; { return(""); }
196char *	ctime(c) long *c;{ return(""); }
197char	_ctype_[];
198DBM *	dbm_open(file, flags, mode) char *file; { return (DBM *) 0; }
199void	dbm_close(db) DBM *db; { ; }
200datum	dbm_fetch(db, key) DBM *db; datum key; { return key; }
201int	dbm_store(db, key, cont, flags) DBM *db; datum key, cont; { return 0; }
202int	dbm_delete(db, key) DBM *db; datum key; { return 0; }
203datum	dbm_firstkey(db) DBM *db; { datum key; return key; }
204datum	dbm_nextkey(db) DBM *db; { datum key; return key; }
205char *	ecvt(v, n, d, s) double v; int *d, *s; { return(""); }
206	encrypt(s, i) char *s; {}
207int	endfsent() { return 0; }
208int	endgrent() { ; }
209	endhostent() { ; }
210	endnetent() { ; }
211	endprotoent() { ; }
212	endpwent() {}
213	endservent() { ; }
214	endttyent() { ; }
215	endusershell() { ; }
216char **	environ;
217	/* VARARGS */
218	execl(f, a) char *f, *a; {;}
219	/* VARARGS */
220	execle(f, a) char *f, *a; {;}
221	/* VARARGS */
222	execlp(f, a) char *f, *a; {;}
223	execv(s, v) char *s, *v[]; {;}
224	execvp(s, v) char *s, *v[]; {;}
225	exect(s, v, e) char *s, *v[], *e[]; {;}
226	exit(s) {;}
227char *	fcvt(v, n, d, s) double v; int *d, *s; { return(""); }
228int	ffs(i) { return i; }
229	free(p) char *p; {;}
230double	frexp( v, e) double v; int *e; { return v; }
231	ftime(tp) struct timeb *tp; { ; }
232char *	gcvt(v, n, b) double v; char *b; { return(""); }
233struct disklabel *	getdiskbyname(name) char *name; { return (struct disklabel *) 0; }
234char *	getenv( n ) char *n; { return n; }
235struct fstab *	getfsent() { return (struct fstab *)NULL; }
236struct fstab *	getfsspec( n ) char *n; { return (struct fstab *)NULL; }
237struct fstab *	getfsfile( n ) char *n; { return (struct fstab *)NULL; }
238struct fstab *	getfstype( t ) char *t; { return (struct fstab *)NULL; }
239struct group *	getgrent() { return (struct group *)NULL; }
240struct group *	getgrgid( n ) { return (struct group *)NULL; }
241struct group *	getgrnam( n ) char *n; { return (struct group *)NULL; }
242struct hostent *	gethostbyaddr(addr, len, type) char *addr; { return (struct hostent *) 0; }
243struct hostent *	gethostbyname(name) char *name; { return (struct hostent *) 0; }
244struct hostent *	gethostent() { return (struct hostent *) 0; }
245int	getloadavg( v, l ) double v[]; int l; { return 0; }
246char *	getlogin(){ return " "; }
247struct netent *	getnetbyaddr(net, type) { return (struct netent *) 0; }
248struct netent *	getnetbyname(name) char *name; { return (struct netent *) 0; }
249struct netent *	getnetent() { return (struct netent *) 0; }
250int	getopt(argc, argv, optstr) char **argv, *optstr; { return EOF; }
251char *	getpass( n ) char *n ; { return n; }
252struct protoent *	getprotobyname(name) char *name; { return (struct protoent *) 0; }
253struct protoent *	getprotobynumber(proto) { return (struct protoent *) 0; }
254struct protoent *	getprotoent() { return (struct protoent *) 0; }
255int	getpw( u, b) char *b;  { return 0; }
256struct passwd *	getpwent() { return (struct passwd *)NULL; }
257struct passwd *	getpwuid( n ) { return (struct passwd *)NULL; }
258struct passwd *	getpwnam( n ) char *n; { return (struct passwd *)NULL; }
259struct servent *	getservbyname(name, proto) char *name, *proto; { return (struct servent *) 0; }
260struct servent *	getservbyport(port, proto) char *proto; { return (struct servent *) 0; }
261struct servent *	getservent() { return (struct servent *) 0; }
262struct ttyent *	getttynam(name) char *name; { return (struct ttyent *) 0; }
263char *	getusershell() { return (char *) 0; }
264char *	getwd(pathname) char *pathname; { return pathname; }
265struct	tm *	gmtime(c) long *c; { return gmtime(c); }
266int	gtty(f, b) struct sgttyb *b; { return(0); }
267#ifndef htonl
268unsigned long htonl(hostlong) u_long hostlong; { return hostlong; }
269#endif htonl
270#ifndef htons
271unsigned short htons(hostshort) u_short hostshort; { return hostshort; }
272#endif htons
273char *	index(s, c) char *s, c; { return s; }
274u_long	inet_addr(cp) char *cp; { return 0L; }
275u_long	inet_lnaof(in) struct in_addr in; { return 0L; }
276u_long	inet_netof(in) struct in_addr in; { return 0L; }
277struct in_addr	inet_makeaddr(net, host) { struct in_addr in; return in; }
278u_long	inet_network(cp) char *cp; { return 0L; }
279char *	inet_ntoa(in) struct in_addr in; { return (char *) 0; }
280int	initgroups(uname, agroup) char *uname; { return 0; }
281char *	initstate( s, st, n) unsigned s; char *st; { return st; }
282	insque(elem, pred) struct qelem *elem, pred; { ; }
283int	isatty(f) { return 1; }
284double	ldexp( v, e) double v; { return v; }
285	longjmp( e, v) jmp_buf e; {;}
286	longjmperror() {;}
287struct	tm *localtime(c) long *c; { return localtime(c); }
288char *	malloc(n) unsigned n; {static char c; return(&c);}
289char *	memccpy(t, f, c, n) char *t, *f; { return t; }
290char *	memchr(s, c, n) char *s; { return s; }
291int	memcmp(s1, s2, n) char *s1, *s2; { return 0; }
292char *	memcpy(t, f, n) char *t, *f; { return t; }
293char *	memset(s, c, n) char *s; { return s; }
294char *	mktemp(p) char *p; { return(p);}
295int	mkstemp(p) char *p; { return(0);}
296double	modf( v, p ) double v, *p; { return v; }
297	moncontrol(mode) { ; }
298	monitor(l, h, b, s, n) int (*l)(), (*h)(); short *b; {}
299	monstartup( l, h) int (*l)(), (*h)(); {;}
300int	nice(incr) { return 0; }
301int	nlist( f, n) char *f; struct nlist n[]; { return (0);}
302struct ns_addr	ns_addr(name) char *name; { struct ns_addr ns; return ns; }
303char *	ns_ntoa(addr) struct ns_addr addr; { return (char *) 0; }
304#ifndef ntohl
305u_long	ntohl(netlong) u_long netlong; { return netlong; }
306#endif ntohl
307#ifndef ntohs
308u_short	ntohs(netshort) u_short netshort; { return netshort; }
309#endif ntohs
310DIR *	opendir( f ) char *f; { return (DIR *)NULL; }
311	openlog(s, f, l) char *s; {}
312char *	optarg;
313int	optind;
314	pause() {;}
315	perror(s) char *s; {}
316	psignal(sig, s) unsigned sig; char *s; {}
317	qsort( b, n, w, c ) char *b; int (*c)(); {;}
318int	rand(){ return 1; }
319long	random() { return 1L; }
320int	rcmd(a, rp, lu, ru, c, f) char **a, *lu, *ru, *c; u_short rp; int *f; { return 0; }
321char *	re_comp(s) char *s ; { return s; }
322int	re_exec(s) char *s ; { return 1; }
323struct direct *	readdir( p ) DIR *p; { return (struct direct *)NULL; }
324char *	realloc(p, n) char *p; unsigned n; { static char c[1]; return(c);}
325	remque(elem) struct qelem *elem; { ; }
326int	rexec(a, rp, n, p, c, f) char **a, *n, *p, *c; u_short rp; int *f; { return 0; }
327char *	rindex(s, c) char *s, c; { return s; }
328int	rresvport(p) int *p; { return 0; }
329int	ruserok(rh, su, ru, lu) char *rh, *ru, *lu; { return 0; }
330int	scandir(d, n, s, c) char *d; struct direct *(*n[]); int (*s)(),(*c)();
331		{ return 1; }
332void	seekdir( p, l) DIR *p; long l; {}
333int	setegid(egid) gid_t egid; { return 0; }
334int	seteuid(euid) uid_t euid; { return 0; }
335int	setfsent() { return 0; }
336int	setgrent() { return 0; }
337int	setgid(g) gid_t g; { return(0); }
338	sethostent(stayopen) { ; }
339	sethostfile(name) char *name; { ; }
340int	setjmp(e) jmp_buf e; { return(0); }
341	setkey(k) char *k; {}
342int	setlogmask(m) { return(0); }
343	setnetent(stayopen) { ; }
344	setprotoent(stayopen) { ; }
345	setpwent() {}
346	setpwfile(file) char *file; {}
347int	setrgid(rgid) gid_t rgid; { return 0; }
348int	setruid(ruid) uid_t ruid; { return 0; }
349	setservent(stayopen) { ; }
350char *	setstate( st ) char *st; { return st; }
351	setttyent() { ; }
352int	setuid(u) uid_t u; { return(0); }
353	setusershell() { ; }
354int	siginterrupt(sig, flag) { return 0; }
355	sleep(i) unsigned i; {}
356int	srand(s){ return s; }
357char *	strcat(a, b) char *a, *b; { return a; }
358char *	strcatn(a, b, n) char *a, *b; { return a;}
359char *	strchr(s, c) char *s, c; { return s; }
360int	strcmp(a, b) char *a, *b; { return(1); }
361int	strcasecmp(a, b) char *a, *b; { return(1); }
362int	strcmpn(a, b, n) char *a, *b; { return(1); }
363char *	strcpy(a, b) char *a, *b; { return a; }
364char *	strcpyn(a, b, n) char *a, *b; { return a; }
365int	strcspn(s, set) char *s, *set; { return(0); }
366int	strlen(s) char *s; { return(1); }
367char *	strncat(a, b, n) char *a, *b; { return a;}
368int	strncmp(a, b, n) char *a, *b; { return(1); }
369int	strncasecmp(a, b, n) char *a, *b; { return(1); }
370char *	strncpy(a, b, n) char *a, *b; { return a; }
371char *	strpbrk(s, brk) char *s, *brk; { return s; }
372char *	strrchr(s, c) char *s, c; { return s; }
373int	strspn(s, set) char *s, *set; { return(0); }
374char *	strtok(s, sep) char *s, *sep; { return s; }
375int	stty(f, b) struct sgttyb *b; { return(0); }
376	swab( f, t, n) char *f, *t; {;}
377	/* VARARGS2 */
378	syslog(l, f) char *f; {}
379char *	sys_errlist[];
380char *	sys_siglist[];
381int	sys_nerr;
382int	system(s) char *s; { return(0); }
383long	tell(f) { return((long)0); }
384long	telldir( p ) DIR *p; { return 1L; }
385long	time(t) long *t; { return( 0L );}
386int	times(tmsp) struct tms *tmsp; { return 0; }
387char *	timezone( z, d ){ return (char *)0; }
388char *	tmpnam(s) char *s; { return s; }
389char *	ttyname(f) { return " "; }
390int	ttyslot() { return 1; }
391unsigned	ualarm(value, interval) unsigned value, interval; { return 0; }
392	usleep(useconds) unsigned useconds; { ; }
393int	utime(name, timep) char *name; time_t *timep; { return 0; }
394char *	valloc(s) unsigned s; { return malloc(s); }
395int	vlimit(limit, value) { return 0; }
396int	vtimes(par, ch) struct vtimes *par, *ch; { return 0; }
397
398	/* standard I/O library */
399
400int	fclose(f) FILE *f; {return(0);}
401FILE *	fdopen(fd, m) char *m; { return(stdin);}
402int	fflush(f) FILE *f; {return(0);}
403int	fgetc(f)  FILE *f; {return 0; }
404char *	fgets( s, l, f ) char *s; FILE *f; { return(s); }
405int	_filbuf( f ) FILE *f; { return 0; }
406int	_flsbuf( c, f ) unsigned char c; FILE *f; { return 0; }
407FILE *	fopen(s,m) char *s, *m; { return(stdin); }
408	/* VARARGS2 */
409	fprintf( f, s ) FILE *f; char *s; {;}
410int	fputc(c, f) char c; FILE *f; {return 0; }
411	fputs(s,f) char *s; FILE *f; {;}
412int	fread( p, s, n, f ) char *p; FILE *f; {return(1);}
413FILE *	freopen(s, m, f) char *s, *m; FILE *f; { return(stdin); }
414	/* VARARGS2 */
415	fscanf( f, s ) FILE *f; char *s; {return(1);}
416int	fseek(f, o, p) FILE *f; long o; { return(0); }
417long	ftell(f) FILE *f; { return(0L); }
418int	fwrite( p, s, n, f ) char *p; FILE *f; {return(0);}
419#ifndef getc
420int	getc(f) FILE *f; { return EOF; }
421#endif getc
422int	getw(f) FILE *f; { return 0;}
423char *	gets( s ) char *s; { return(s); }
424struct _iobuf _iob[];
425int	pclose( f ) FILE *f; { return 0; }
426FILE *	popen( c, t ) char *c, *t; { return(stdin); }
427	/* VARARGS1 */
428	printf( s ) char *s; {;}
429	puts(s) char *s;{;}
430#ifndef putc
431int	putc(c, f) char c; FILE *f; { return 0; }
432#endif putc
433int	putw(w, f) FILE *f; { return 0;}
434	rewind(f) FILE *f; {;}
435	/* VARARGS1 */
436	scanf( f ) char *f; {return(1); }
437	setbuf( f, b ) FILE *f; char *b; {;}
438	setbuffer( f, b, s ) FILE *f; char *b; {;}
439	setlinebuf( f ) FILE *f; {;}
440	/* VARARGS2 */
441int	sprintf( s, f ) char *s, *f; { return(s);}
442	/* VARARGS2 */
443	sscanf( s, f ) char *s, *f; { return(1); }
444	ungetc( c, f ) FILE *f; {  return(c); }
445