1/* @(#)llib-lc 1.37 (Berkeley) 05/17/86 */ 2 3/* LINTLIBRARY */ 4 5#include <sys/types.h> 6#include <sys/time.h> 7 8#include <sys/dir.h> 9#include <sys/resource.h> 10#include <sys/socket.h> 11#include <sys/stat.h> 12#include <sys/timeb.h> 13#include <sys/times.h> 14#include <sys/uio.h> 15#include <sys/vtimes.h> 16#include <sys/wait.h> 17 18#include <netinet/in.h> 19 20#include <netns/ns.h> 21 22#include <arpa/inet.h> 23 24#include <disktab.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) char *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() { return 0; } 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 disktab * getdiskbyname(name) char *name; { return (struct disktab *) 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; } 245char * getlogin(){ return " "; } 246struct netent * getnetbyaddr(net, type) { return (struct netent *) 0; } 247struct netent * getnetbyname(name) char *name; { return (struct netent *) 0; } 248struct netent * getnetent() { return (struct netent *) 0; } 249int getopt(argc, argv, optstr) char **argv, *optstr; { return EOF; } 250char * getpass( n ) char *n ; { return n; } 251struct protoent * getprotobyname(name) char *name; { return (struct protoent *) 0; } 252struct protoent * getprotobynumber(proto) { return (struct protoent *) 0; } 253struct protoent * getprotoent() { return (struct protoent *) 0; } 254int getpw( u, b) char *b; { return 0; } 255struct passwd * getpwent() { return (struct passwd *)NULL; } 256struct passwd * getpwuid( n ) { return (struct passwd *)NULL; } 257struct passwd * getpwnam( n ) char *n; { return (struct passwd *)NULL; } 258struct servent * getservbyname(name, proto) char *name, *proto; { return (struct servent *) 0; } 259struct servent * getservbyport(port, proto) char *proto; { return (struct servent *) 0; } 260struct servent * getservent() { return (struct servent *) 0; } 261struct ttyent * getttynam(name) char *name; { return (struct ttyent *) 0; } 262char * getusershell() { return (char *) 0; } 263char * getwd(pathname) char *pathname; { return pathname; } 264struct tm * gmtime(c) long *c; { return gmtime(c); } 265int gtty(f, b) struct sgttyb *b; { return(0); } 266#ifndef htonl 267u_long htonl(hostlong) u_long hostlong; { return hostlong; } 268#endif htonl 269#ifndef htons 270u_short htons(hostshort) u_short hostshort; { return hostshort; } 271#endif htons 272char * index(s, c) char *s, c; { return s; } 273u_long inet_addr(cp) char *cp; { return 0L; } 274int inet_lnaof(in) struct in_addr in; { return 0; } 275int inet_netof(in) struct in_addr in; { return 0; } 276struct in_addr inet_makeaddr(net, host) { struct in_addr in; return in; } 277u_long inet_network(cp) char *cp; { return 0L; } 278char * inet_ntoa(in) struct in_addr in; { return (char *) 0; } 279int initgroups(uname, agroup) char *uname; { return 0; } 280char * initstate( s, st, n) unsigned s; char *st; { return st; } 281 insque(elem, pred) struct qelem *elem, pred; { ; } 282int isatty(f) { return 1; } 283double ldexp( v, e) double v; { return v; } 284 longjmp( e, v) jmp_buf e; {;} 285 longjmperror() {;} 286struct tm *localtime(c) long *c; { return localtime(c); } 287char * malloc(n) unsigned n; {static char c; return(&c);} 288char * memccpy(t, f, c, n) char *t, *f; { return t; } 289char * memchr(s, c, n) char *s; { return s; } 290int memcmp(s1, s2, n) char *s1, *s2; { return 0; } 291char * memcpy(t, f, n) char *t, *f; { return t; } 292char * memset(s, c, n) char *s; { return s; } 293char * mktemp(p) char *p; { return(p);} 294int mkstemp(p) char *p; { return(0);} 295double modf( v, p ) double v, *p; { return v; } 296 moncontrol(mode) { ; } 297 monitor(l, h, b, s, n) int (*l)(), (*h)(); short *b; {} 298 monstartup( l, h) int (*l)(), (*h)(); {;} 299int nice(incr) { return 0; } 300int nlist( f, n) char *f; struct nlist n[]; { return (0);} 301struct ns_addr ns_addr(name) char *name; { struct ns_addr ns; return ns; } 302char * ns_ntoa(addr) struct ns_addr addr; { return (char *) 0; } 303#ifndef ntohl 304u_long ntohl(netlong) u_long netlong; { return netlong; } 305#endif ntohl 306#ifndef ntohs 307u_short ntohs(netshort) u_short netshort; { return netshort; } 308#endif ntohs 309DIR * opendir( f ) char *f; { return (DIR *)NULL; } 310 openlog(s, f, l) char *s; {} 311char * optarg; 312int optind; 313 pause() {;} 314 perror(s) char *s; {} 315 psignal(sig, s) unsigned sig; char *s; {} 316 qsort( b, n, w, c ) char *b; int (*c)(); {;} 317int rand(){ return 1; } 318long random() { return 1L; } 319int rcmd(a, rp, lu, ru, c, f) char **a, *lu, *ru, *c; u_short rp; int *f; { return 0; } 320char * re_comp(s) char *s ; { return s; } 321int re_exec(s) char *s ; { return 1; } 322struct direct * readdir( p ) DIR *p; { return (struct direct *)NULL; } 323char * realloc(p, n) char *p; unsigned n; { static char c[1]; return(c);} 324 remque(elem) struct qelem *elem; { ; } 325int rexec(a, rp, n, p, c, f) char **a, *n, *p, *c; u_short rp; int *f; { return 0; } 326char * rindex(s, c) char *s, c; { return s; } 327int rresvport(p) int *p; { return 0; } 328int ruserok(rh, su, ru, lu) char *rh, *ru, *lu; { return 0; } 329int scandir(d, n, s, c) char *d; struct direct *(*n[]); int (*s)(),(*c)(); 330 { return 1; } 331void seekdir( p, l) DIR *p; long l; {} 332int setegid(egid) gid_t egid; { return 0; } 333int seteuid(euid) uid_t euid; { return 0; } 334int setfsent() { return 0; } 335int setgrent() { return 0; } 336int setgid(g) gid_t g; { return(0); } 337 sethostent(stayopen) { ; } 338 sethostfile(name) char *name; { ; } 339int setjmp(e) jmp_buf e; { return(0); } 340 setkey(k) char *k; {} 341int setlogmask(m) { return(0); } 342 setnetent(stayopen) { ; } 343 setprotoent(stayopen) { ; } 344 setpwent() {} 345 setpwfile(file) char *file; {} 346int setrgid(rgid) gid_t rgid; { return 0; } 347int setruid(ruid) uid_t ruid; { return 0; } 348 setservent(stayopen) { ; } 349char * setstate( st ) char *st; { return st; } 350 setttyent() { ; } 351int setuid(u) uid_t u; { return(0); } 352 setusershell() { ; } 353int siginterrupt(sig, flag) { return 0; } 354 sleep(i) unsigned i; {} 355int srand(s){ return s; } 356char * strcat(a, b) char *a, *b; { return a; } 357char * strcatn(a, b, n) char *a, *b; { return a;} 358char * strchr(s, c) char *s, c; { return s; } 359int strcmp(a, b) char *a, *b; { return(1); } 360int strcmpn(a, b, n) char *a, *b; { return(1); } 361char * strcpy(a, b) char *a, *b; { return a; } 362char * strcpyn(a, b, n) char *a, *b; { return a; } 363int strcspn(s, set) char *s, *set; { return(0); } 364int strlen(s) char *s; { return(1); } 365char * strncat(a, b, n) char *a, *b; { return a;} 366int strncmp(a, b, n) char *a, *b; { return(1); } 367char * strncpy(a, b, n) char *a, *b; { return a; } 368char * strpbrk(s, brk) char *s, *brk; { return s; } 369char * strrchr(s, c) char *s, c; { return s; } 370int strspn(s, set) char *s, *set; { return(0); } 371char * strtok(s, sep) char *s, *sep; { return s; } 372int stty(f, b) struct sgttyb *b; { return(0); } 373 swab( f, t, n) char *f, *t; {;} 374 /* VARARGS2 */ 375 syslog(l, f) char *f; {} 376char * sys_errlist[]; 377char * sys_siglist[]; 378int sys_nerr; 379int system(s) char *s; { return(0); } 380long tell(f) { return((long)0); } 381long telldir( p ) DIR *p; { return 1L; } 382long time(t) long *t; { return( 0L );} 383int times(tmsp) struct tms *tmsp; { return 0; } 384char * timezone( z, d ){ return (char *)0; } 385char * tmpnam(s) char *s; { return s; } 386char * ttyname(f) { return " "; } 387int ttyslot() { return 1; } 388unsigned ualarm(value, interval) unsigned value, interval; { return 0; } 389 usleep(useconds) unsigned useconds; { ; } 390int utime(name, timep) char *name; time_t *timep; { return 0; } 391char * valloc(s) unsigned s; { return malloc(s); } 392int vlimit(limit, value) { return 0; } 393int vtimes(par, ch) struct vtimes *par, *ch; { return 0; } 394 395 /* standard I/O library */ 396 397int fclose(f) FILE *f; {return(0);} 398FILE * fdopen(fd, m) char *m; { return(stdin);} 399int fflush(f) FILE *f; {return(0);} 400int fgetc(f) FILE *f; {return 0; } 401char * fgets( s, l, f ) char *s; FILE *f; { return(s); } 402int _filbuf( f ) FILE *f; { return 0; } 403int _flsbuf( c, f ) unsigned char c; FILE *f; { return 0; } 404FILE * fopen(s,m) char *s, *m; { return(stdin); } 405 /* VARARGS2 */ 406 fprintf( f, s ) FILE *f; char *s; {;} 407int fputc(c, f) char c; FILE *f; {return 0; } 408 fputs(s,f) char *s; FILE *f; {;} 409int fread( p, s, n, f ) char *p; FILE *f; {return(1);} 410FILE * freopen(s, m, f) char *s, *m; FILE *f; { return(stdin); } 411 /* VARARGS2 */ 412 fscanf( f, s ) FILE *f; char *s; {return(1);} 413int fseek(f, o, p) FILE *f; long o; { return(0); } 414long ftell(f) FILE *f; { return(0L); } 415int fwrite( p, s, n, f ) char *p; FILE *f; {return(0);} 416#ifndef getc 417int getc(f) FILE *f; { return EOF; } 418#endif getc 419int getw(f) FILE *f; { return 0;} 420char * gets( s ) char *s; { return(s); } 421struct _iobuf _iob[]; 422int pclose( f ) FILE *f; { return 0; } 423FILE * popen( c, t ) char *c, *t; { return(stdin); } 424 /* VARARGS1 */ 425 printf( s ) char *s; {;} 426 puts(s) char *s;{;} 427#ifndef putc 428int putc(c, f) char c; FILE *f; { return 0; } 429#endif putc 430int putw(w, f) FILE *f; { return 0;} 431 rewind(f) FILE *f; {;} 432 /* VARARGS1 */ 433 scanf( f ) char *f; {return(1); } 434 setbuf( f, b ) FILE *f; char *b; {;} 435 setbuffer( f, b, s ) FILE *f; char *b; {;} 436 setlinebuf( f ) FILE *f; {;} 437 /* VARARGS2 */ 438char * sprintf( s, f ) char *s, *f; { return(s);} 439 /* VARARGS2 */ 440 sscanf( s, f ) char *s, *f; { return(1); } 441 ungetc( c, f ) FILE *f; { return(c); } 442