From: Nick Downing Date: Mon, 23 Jan 2017 02:14:55 +0000 (+1100) Subject: Permanently apply syscall stubs and pre.patch changes to various directories X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=7ad5bc76545bbea8b338315cab9622ac4ef6b73c;p=43bsd.git Permanently apply syscall stubs and pre.patch changes to various directories --- diff --git a/.gitignore b/.gitignore index 83a041d..2d4712f 100644 --- a/.gitignore +++ b/.gitignore @@ -19,7 +19,6 @@ cproto-4.6/stamp-h cproto-4.6/y.tab.c cross lib/libx_c.post -lib/libx_c.pre lib/libx_c/*.temp lib/libx_c/compat-4.1/compat-4.1lib lib/libx_c/compat-4.1/compat-4.1lib_p diff --git a/include/curses.h b/include/curses.h deleted file mode 120000 index 6c8cd06..0000000 --- a/include/curses.h +++ /dev/null @@ -1 +0,0 @@ -/usr/src/usr.lib/libcurses/curses.h \ No newline at end of file diff --git a/include/fcntl.h b/include/fcntl.h deleted file mode 100644 index 5fd458f..0000000 --- a/include/fcntl.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 1983 Regents of the University of California. - * All rights reserved. The Berkeley software License Agreement - * specifies the terms and conditions for redistribution. - * - * @(#)fcntl.h 5.2 (Berkeley) 1/8/86 - */ - -/* - * Flag values accessible to open(2) and fcntl(2)-- copied from - * . (The first three can only be set by open.) - */ -#define O_RDONLY 000 /* open for reading */ -#define O_WRONLY 001 /* open for writing */ -#define O_RDWR 002 /* open for read & write */ -#define O_NDELAY FNDELAY /* non-blocking open */ - /* really non-blocking I/O for fcntl */ -#define O_APPEND FAPPEND /* append on each write */ -#define O_CREAT FCREAT /* open with file create */ -#define O_TRUNC FTRUNC /* open with truncation */ -#define O_EXCL FEXCL /* error on create if file exists */ - -#ifndef F_DUPFD -/* fcntl(2) requests */ -#define F_DUPFD 0 /* Duplicate fildes */ -#define F_GETFD 1 /* Get fildes flags */ -#define F_SETFD 2 /* Set fildes flags */ -#define F_GETFL 3 /* Get file flags */ -#define F_SETFL 4 /* Set file flags */ -#define F_GETOWN 5 /* Get owner */ -#define F_SETOWN 6 /* Set owner */ - -/* flags for F_GETFL, F_SETFL-- copied from */ -#define FNDELAY 00004 /* non-blocking reads */ -#define FAPPEND 00010 /* append on each write */ -#define FASYNC 00100 /* signal pgrp when data ready */ -#define FCREAT 01000 /* create if nonexistant */ -#define FTRUNC 02000 /* truncate to zero length */ -#define FEXCL 04000 /* error if already created */ -#endif diff --git a/include/gen.h b/include/gen.h new file mode 100644 index 0000000..c0a77d9 --- /dev/null +++ b/include/gen.h @@ -0,0 +1,5 @@ +/* formerly duplicated in gen/insque.c and gen/remque.c */ +struct vaxque { /* queue format expected by VAX queue instructions */ + struct vaxque *vq_next; + struct vaxque *vq_prev; +}; diff --git a/include/mp.h b/include/mp.h deleted file mode 100644 index 05a1d39..0000000 --- a/include/mp.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 1980 Regents of the University of California. - * All rights reserved. The Berkeley software License Agreement - * specifies the terms and conditions for redistribution. - * - * @(#)mp.h 5.1 (Berkeley) 5/30/85 - */ - -#define MINT struct mint -MINT -{ int len; - short *val; -}; -#define FREE(x) {if(x.len!=0) {free((char *)x.val); x.len=0;}} -#ifndef DBG -#define shfree(u) free((char *)u) -#else -#include -#define shfree(u) { if(dbg) fprintf(stderr, "free %o\n", u); free((char *)u);} -extern int dbg; -#endif -#ifndef vax -struct half -{ short high; - short low; -}; -#else -struct half -{ short low; - short high; -}; -#endif -extern MINT *itom(); -extern short *xalloc(); - -#ifdef lint -extern xv_oid; -#define VOID xv_oid = -#else -#define VOID -#endif diff --git a/include/net.h b/include/net.h new file mode 100644 index 0000000..7c94432 --- /dev/null +++ b/include/net.h @@ -0,0 +1,6 @@ +/* + * Functions for number representation conversion. + */ +/* formerly duplicated in netinet/in.h and netns/ns.h */ +u_short ntohs(), htons(); +u_long ntohl(), htonl(); diff --git a/include/nlist.h b/include/nlist.h deleted file mode 100644 index 6b5b8ba..0000000 --- a/include/nlist.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 1980 Regents of the University of California. - * All rights reserved. The Berkeley software License Agreement - * specifies the terms and conditions for redistribution. - * - * @(#)nlist.h 5.1 (Berkeley) 5/30/85 - */ - -/* - * Format of a symbol table entry; this file is included by - * and should be used if you aren't interested the a.out header - * or relocation information. - */ -struct nlist { - char *n_name; /* for use when in-core */ - unsigned char n_type; /* type flag, i.e. N_TEXT etc; see below */ - char n_other; /* unused */ - short n_desc; /* see */ - unsigned long n_value; /* value of this symbol (or sdb offset) */ -}; -#define n_hash n_desc /* used internally by ld */ - -/* - * Simple values for n_type. - */ -#define N_UNDF 0x0 /* undefined */ -#define N_ABS 0x2 /* absolute */ -#define N_TEXT 0x4 /* text */ -#define N_DATA 0x6 /* data */ -#define N_BSS 0x8 /* bss */ -#define N_COMM 0x12 /* common (internal to ld) */ -#define N_FN 0x1f /* file name symbol */ - -#define N_EXT 01 /* external bit, or'ed in */ -#define N_TYPE 0x1e /* mask for all the type bits */ - -/* - * Sdb entries have some of the N_STAB bits set. - * These are given in - */ -#define N_STAB 0xe0 /* if any of these bits set, a SDB entry */ - -/* - * Format for namelist values. - */ -#define N_FORMAT "%08x" diff --git a/include/stdio.h b/include/stdio.h index 2001be8..ca9648c 100644 --- a/include/stdio.h +++ b/include/stdio.h @@ -59,7 +59,7 @@ FILE *popen(); long ftell(); char *fgets(); char *gets(); -#ifdef vax +#if 0 /*def vax*/ char *sprintf(); /* too painful to do right */ #endif # endif diff --git a/lib/libc/compat-4.1/Makefile b/lib/libc/compat-4.1/Makefile index 927aac7..4080fd5 100644 --- a/lib/libc/compat-4.1/Makefile +++ b/lib/libc/compat-4.1/Makefile @@ -59,4 +59,3 @@ depend: # DO NOT DELETE THIS LINE -- make depend uses it - diff --git a/lib/libc/compat-4.1/ftime.c b/lib/libc/compat-4.1/ftime.c index 243902d..ec24405 100644 --- a/lib/libc/compat-4.1/ftime.c +++ b/lib/libc/compat-4.1/ftime.c @@ -10,18 +10,20 @@ static char sccsid[] = "@(#)ftime.c 5.2 (Berkeley) 3/9/86"; #include #include +#include /* * Backwards compatible ftime. */ +/* we now get this from sys/timeb.h to avoid duplication */ /* from old timeb.h */ -struct timeb { - time_t time; - u_short millitm; - short timezone; - short dstflag; -}; +/*struct timeb {*/ +/* time_t time;*/ +/* u_short millitm;*/ +/* short timezone;*/ +/* short dstflag;*/ +/*};*/ ftime(tp) register struct timeb *tp; diff --git a/lib/libc/compat-4.1/gtty.c b/lib/libc/compat-4.1/gtty.c index 9e589ae..7c4372c 100644 --- a/lib/libc/compat-4.1/gtty.c +++ b/lib/libc/compat-4.1/gtty.c @@ -15,8 +15,7 @@ static char sccsid[] = "@(#)gtty.c 5.2 (Berkeley) 3/9/86"; #include gtty(fd, ap) - struct sgtty *ap; + struct sgttyb *ap; { - return(ioctl(fd, TIOCGETP, ap)); } diff --git a/lib/libc/compat-4.1/stty.c b/lib/libc/compat-4.1/stty.c index 6253baf..beb475a 100644 --- a/lib/libc/compat-4.1/stty.c +++ b/lib/libc/compat-4.1/stty.c @@ -15,8 +15,7 @@ static char sccsid[] = "@(#)stty.c 5.2 (Berkeley) 3/9/86"; #include stty(fd, ap) - struct sgtty *ap; + struct sgttyb *ap; { - return(ioctl(fd, TIOCSETP, ap)); } diff --git a/lib/libc/compat-4.1/times.c b/lib/libc/compat-4.1/times.c index 7843072..8293649 100644 --- a/lib/libc/compat-4.1/times.c +++ b/lib/libc/compat-4.1/times.c @@ -10,16 +10,18 @@ static char sccsid[] = "@(#)times.c 5.2 (Berkeley) 3/9/86"; #include #include +#include /* * Backwards compatible times. */ -struct tms { - int tms_utime; /* user time */ - int tms_stime; /* system time */ - int tms_cutime; /* user time, children */ - int tms_cstime; /* system time, children */ -}; +/* we now get this from sys/times.h to avoid duplication */ +/*struct tms {*/ +/* int tms_utime;*/ /* user time */ +/* int tms_stime;*/ /* system time */ +/* int tms_cutime;*/ /* user time, children */ +/* int tms_cstime;*/ /* system time, children */ +/*};*/ times(tmsp) register struct tms *tmsp; diff --git a/lib/libc/compat-4.1/vtimes.c b/lib/libc/compat-4.1/vtimes.c index e689501..cb3b61b 100644 --- a/lib/libc/compat-4.1/vtimes.c +++ b/lib/libc/compat-4.1/vtimes.c @@ -10,23 +10,25 @@ static char sccsid[] = "@(#)vtimes.c 5.2 (Berkeley) 3/9/86"; #include #include +#include /* * Backwards compatible vtimes. */ -struct vtimes { - int vm_utime; /* user time (60'ths) */ - int vm_stime; /* system time (60'ths) */ +/* we now get this from sys/vtimes.h to avoid duplication */ +/*struct vtimes {*/ +/* int vm_utime;*/ /* user time (60'ths) */ +/* int vm_stime;*/ /* system time (60'ths) */ /* divide next two by utime+stime to get averages */ - unsigned vm_idsrss; /* integral of d+s rss */ - unsigned vm_ixrss; /* integral of text rss */ - int vm_maxrss; /* maximum rss */ - int vm_majflt; /* major page faults */ - int vm_minflt; /* minor page faults */ - int vm_nswap; /* number of swaps */ - int vm_inblk; /* block reads */ - int vm_oublk; /* block writes */ -}; +/* unsigned vm_idsrss;*/ /* integral of d+s rss */ +/* unsigned vm_ixrss;*/ /* integral of text rss */ +/* int vm_maxrss;*/ /* maximum rss */ +/* int vm_majflt;*/ /* major page faults */ +/* int vm_minflt;*/ /* minor page faults */ +/* int vm_nswap;*/ /* number of swaps */ +/* int vm_inblk;*/ /* block reads */ +/* int vm_oublk;*/ /* block writes */ +/*};*/ vtimes(par, chi) register struct vtimes *par, *chi; diff --git a/lib/libc/compat-sys5/Makefile b/lib/libc/compat-sys5/Makefile index 4aa6b25..4af68bc 100644 --- a/lib/libc/compat-sys5/Makefile +++ b/lib/libc/compat-sys5/Makefile @@ -51,22 +51,3 @@ depend: # DO NOT DELETE THIS LINE -- make depend uses it -getopt.o: getopt.c /usr/include/stdio.h -memccpy.o: memccpy.c -memchr.o: memchr.c -memcmp.o: memcmp.c -memcpy.o: memcpy.c -memset.o: memset.c -strcatn.o: strcatn.c -strchr.o: strchr.c -strcmpn.o: strcmpn.c -strcpyn.o: strcpyn.c -strcspn.o: strcspn.c -strpbrk.o: strpbrk.c -strrchr.o: strrchr.c -strspn.o: strspn.c -strtok.o: strtok.c -tmpnam.o: tmpnam.c -# DEPENDENCIES MUST END AT END OF FILE -# IF YOU PUT STUFF HERE IT WILL GO AWAY -# see make depend above diff --git a/lib/libc/compat-sys5/memccpy.c b/lib/libc/compat-sys5/memccpy.c index 381a24f..9bed847 100644 --- a/lib/libc/compat-sys5/memccpy.c +++ b/lib/libc/compat-sys5/memccpy.c @@ -13,12 +13,16 @@ static char sccsid[] = "@(#)memccpy.c 5.2 (Berkeley) 86/03/09"; #endif char * -memccpy(t, f, c, n) - register char *t, *f; +memccpy(_t, _f, c, n) + void *_t, *_f; register c, n; { +#define t (*(char **)&_t) +#define f (*(char **)&_f) while (--n >= 0) if ((*t++ = *f++) == c) return (t); return (0); +#undef t +#undef f } diff --git a/lib/libc/compat-sys5/memchr.c b/lib/libc/compat-sys5/memchr.c index 3093347..14fb81c 100644 --- a/lib/libc/compat-sys5/memchr.c +++ b/lib/libc/compat-sys5/memchr.c @@ -12,13 +12,15 @@ static char sccsid[] = "@(#)memchr.c 5.2 (Berkeley) 86/03/09"; #endif -char * -memchr(s, c, n) - register char *s; +void * +memchr(_s, c, n) + void *_s; register c, n; { +#define s (*(char **)&_s) while (--n >= 0) if (*s++ == c) return (--s); return (0); +#undef s } diff --git a/lib/libc/compat-sys5/memcmp.c b/lib/libc/compat-sys5/memcmp.c index e6b2a50..f2cd066 100644 --- a/lib/libc/compat-sys5/memcmp.c +++ b/lib/libc/compat-sys5/memcmp.c @@ -12,12 +12,16 @@ static char sccsid[] = "@(#)memcmp.c 5.2 (Berkeley) 86/03/09"; #endif -memcmp(s1, s2, n) - register char *s1, *s2; +memcmp(_s1, _s2, n) + void *_s1, *_s2; register n; { +#define s1 (*(char **)&_s1) +#define s2 (*(char **)&_s2) while (--n >= 0) if (*s1++ != *s2++) return (*--s1 - *--s2); return (0); +#undef s1 +#undef s2 } diff --git a/lib/libc/compat-sys5/memcpy.c b/lib/libc/compat-sys5/memcpy.c index 487fd70..29e06af 100644 --- a/lib/libc/compat-sys5/memcpy.c +++ b/lib/libc/compat-sys5/memcpy.c @@ -12,15 +12,19 @@ static char sccsid[] = "@(#)memcpy.c 5.2 (Berkeley) 86/03/09"; #endif -char * -memcpy(t, f, n) - register char *t, *f; +void * +memcpy(_t, _f, n) + void *_t, *_f; register n; { +#define t (*(char **)&_t) +#define f (*(char **)&_f) register char *p = t; while (--n >= 0) *t++ = *f++; return (p); +#undef t +#undef f } diff --git a/lib/libc/compat-sys5/memset.c b/lib/libc/compat-sys5/memset.c index 2600ed5..7769840 100644 --- a/lib/libc/compat-sys5/memset.c +++ b/lib/libc/compat-sys5/memset.c @@ -12,15 +12,17 @@ static char sccsid[] = "@(#)memset.c 5.2 (Berkeley) 86/03/09"; #endif -char * -memset(s, c, n) - register char *s; +void * +memset(_s, c, n) + void *_s; register c, n; { +#define s (*(char **)&_s) register char *p = s; while (--n >= 0) *s++ = c; return (p); +#undef s } diff --git a/lib/libc/gen/Makefile b/lib/libc/gen/Makefile index 37273f7..9415798 100644 --- a/lib/libc/gen/Makefile +++ b/lib/libc/gen/Makefile @@ -5,44 +5,34 @@ # # @(#)Makefile 5.7 (Berkeley) 3/26/86 # -# Several routines have been rewritten in assembly language for the VAX. -# If you are not running on a VAX, you should use the original C sources -# which are included in this directory. Regretably we do not have a C -# version of the bstring(3) routines. -# -#ifndef vax -#SRCS= ${STDSRC} ${VAXSRC} -#OBJS= ${STDOBJ} ${VAXOBJ} -#else -SRCS= ${STDSRC} -OBJS= ${STDOBJ} -#endif not vax -CFLAGS= -O ${DEFS} -STDSRC= abort.c alarm.c atoi.c atol.c calloc.c closedir.c crypt.c \ - ctime.c ctype_.c errlst.c execvp.c fakcu.c fstab.c gcvt.c getenv.c \ +SRCS= abort.c abs.c alarm.c atof.c atoi.c atol.c bcmp.c bcopy.c bzero.c \ + calloc.c closedir.c crypt.c ctime.c ctype_.c disktab.c ecvt.c \ + errlst.c execvp.c fakcu.c ffs.c frexp.c fstab.c gcvt.c getenv.c \ getgrent.c getgrgid.c getgrnam.c getlogin.c getpass.c getpwent.c \ - getpwnamuid.c getttyent.c getttynam.c getusershell.c getwd.c \ - initgroups.c isatty.c malloc.c mkstemp.c mktemp.c ndbm.c nlist.c \ - opendir.c perror.c popen.c psignal.c qsort.c random.c readdir.c \ - regex.c scandir.c seekdir.c setgid.c setegid.c setrgid.c setuid.c \ - seteuid.c setruid.c siglist.c signal.c siginterrupt.c sleep.c \ - swab.c syslog.c system.c telldir.c time.c timezone.c ttyname.c \ - ttyslot.c ualarm.c usleep.c valloc.c -VAXSRC= index.c rindex.c strcat.c strcmp.c strcpy.c strlen.c \ - strncat.c strncmp.c strncpy.c -STDOBJ= abort.o alarm.o atoi.o atol.o calloc.o closedir.o crypt.o \ - ctime.o ctype_.o errlst.o execvp.o fakcu.o fstab.o gcvt.o getenv.o \ + getpwnamuid.c getttyent.c getttynam.c getusershell.c getwd.c index.c \ + initgroups.c insque.c ldexp.c malloc.c mkstemp.c mktemp.c modf.c \ + ndbm.c nlist.c opendir.c perror.c psignal.c qsort.c random.c \ + readdir.c regex.c remque.c rindex.c scandir.c seekdir.c setegid.c \ + seteuid.c setgid.c _setjmp.c setjmp.c setjmperr.c setrgid.c setruid.c \ + setuid.c siginterrupt.c siglist.c signal.c sleep.c strcat.c strcmp.c \ + strcpy.c strlen.c strncat.c strncmp.c strncpy.c swab.c syslog.c \ + system.c telldir.c time.c timezone.c ttyname.c ttyslot.c ualarm.c \ + usleep.c valloc.c +OBJS= abort.o abs.o alarm.o atof.o atoi.o atol.o bcmp.o bcopy.o bzero.o \ + calloc.o closedir.o crypt.o ctime.o ctype_.o disktab.o ecvt.o \ + errlst.o execvp.o fakcu.o ffs.o frexp.o fstab.o gcvt.o getenv.o \ getgrent.o getgrgid.o getgrnam.o getlogin.o getpass.o getpwent.o \ - getpwnamuid.o getttyent.o getttynam.o getusershell.o getwd.o \ - initgroups.o isatty.o malloc.o mkstemp.o mktemp.o ndbm.o nlist.o \ - opendir.o perror.o popen.o psignal.o qsort.o random.o readdir.o \ - regex.o scandir.o seekdir.o setgid.o setegid.o setrgid.o setuid.o \ - seteuid.o setruid.o siglist.o signal.o siginterrupt.o sleep.o \ - swab.o syslog.o system.o telldir.o time.o timezone.o ttyname.o \ - ttyslot.o ualarm.o usleep.o valloc.o -VAXOBJ= index.o rindex.o strcat.o strcmp.o strcpy.o strlen.o \ - strncat.o strncmp.o strncpy.o + getpwnamuid.o getttyent.o getttynam.o getusershell.o getwd.o index.o \ + initgroups.o insque.o ldexp.o malloc.o mkstemp.o mktemp.o modf.o \ + ndbm.o nlist.o opendir.o perror.o psignal.o qsort.o random.o \ + readdir.o regex.o remque.o rindex.o scandir.o seekdir.o setegid.o \ + seteuid.o setgid.o _setjmp.o setjmp.o setjmperr.o setrgid.o setruid.o \ + setuid.o siginterrupt.o siglist.o signal.o sleep.o strcat.o strcmp.o \ + strcpy.o strlen.o strncat.o strncmp.o strncpy.o swab.o syslog.o \ + system.o telldir.o time.o timezone.o ttyname.o ttyslot.o ualarm.o \ + usleep.o valloc.o +CFLAGS= -O ${DEFS} TAGSFILE=tags .c.o: @@ -94,106 +84,3 @@ depend: # DO NOT DELETE THIS LINE -- make depend uses it -abort.o: abort.c /usr/include/signal.h -alarm.o: alarm.c /usr/include/sys/time.h /usr/include/time.h -atoi.o: atoi.c -atol.o: atol.c -calloc.o: calloc.c -closedir.o: closedir.c /usr/include/sys/param.h -closedir.o: /usr/include/machine/machparam.h /usr/include/signal.h -closedir.o: /usr/include/sys/types.h /usr/include/sys/dir.h -crypt.o: crypt.c -ctime.o: ctime.c /usr/include/sys/time.h /usr/include/time.h -ctime.o: /usr/include/sys/types.h /usr/include/sys/timeb.h -ctype_.o: ctype_.c /usr/include/ctype.h -errlst.o: errlst.c -execvp.o: execvp.c /usr/include/errno.h -fakcu.o: fakcu.c -fstab.o: fstab.c /usr/include/fstab.h /usr/include/stdio.h /usr/include/ctype.h -gcvt.o: gcvt.c -getenv.o: getenv.c -getgrent.o: getgrent.c /usr/include/stdio.h /usr/include/grp.h -getgrgid.o: getgrgid.c /usr/include/grp.h -getgrnam.o: getgrnam.c /usr/include/grp.h -getlogin.o: getlogin.c /usr/include/utmp.h -getpass.o: getpass.c /usr/include/stdio.h /usr/include/signal.h -getpass.o: /usr/include/sgtty.h /usr/include/sys/ioctl.h -getpass.o: /usr/include/sys/ttychars.h /usr/include/sys/ttydev.h -getpwent.o: getpwent.c /usr/include/stdio.h /usr/include/pwd.h -getpwent.o: /usr/include/ndbm.h -getpwnamuid.o: getpwnamuid.c /usr/include/stdio.h /usr/include/pwd.h -getpwnamuid.o: /usr/include/ndbm.h /usr/include/sys/file.h -getttyent.o: getttyent.c /usr/include/stdio.h /usr/include/strings.h -getttyent.o: /usr/include/ttyent.h -getttynam.o: getttynam.c /usr/include/ttyent.h -getusershell.o: getusershell.c /usr/include/sys/param.h -getusershell.o: /usr/include/machine/machparam.h /usr/include/signal.h -getusershell.o: /usr/include/sys/types.h /usr/include/sys/file.h -getusershell.o: /usr/include/sys/stat.h /usr/include/ctype.h -getusershell.o: /usr/include/stdio.h -getwd.o: getwd.c /usr/include/sys/param.h /usr/include/machine/machparam.h -getwd.o: /usr/include/signal.h /usr/include/sys/types.h /usr/include/sys/stat.h -getwd.o: /usr/include/sys/dir.h -initgroups.o: initgroups.c /usr/include/stdio.h /usr/include/sys/param.h -initgroups.o: /usr/include/machine/machparam.h /usr/include/signal.h -initgroups.o: /usr/include/sys/types.h /usr/include/grp.h -isatty.o: isatty.c /usr/include/sgtty.h /usr/include/sys/ioctl.h -isatty.o: /usr/include/sys/ttychars.h /usr/include/sys/ttydev.h -malloc.o: malloc.c /usr/include/sys/types.h -mkstemp.o: mkstemp.c /usr/include/sys/file.h -mktemp.o: mktemp.c -ndbm.o: ndbm.c /usr/include/sys/types.h /usr/include/sys/stat.h -ndbm.o: /usr/include/sys/file.h /usr/include/stdio.h /usr/include/errno.h -ndbm.o: /usr/include/ndbm.h -nlist.o: nlist.c /usr/include/sys/types.h /usr/include/a.out.h -nlist.o: /usr/include/sys/exec.h /usr/include/stdio.h -opendir.o: opendir.c /usr/include/sys/param.h /usr/include/machine/machparam.h -opendir.o: /usr/include/signal.h /usr/include/sys/types.h -opendir.o: /usr/include/sys/dir.h -perror.o: perror.c /usr/include/sys/types.h /usr/include/sys/uio.h -popen.o: popen.c /usr/include/stdio.h /usr/include/signal.h -psignal.o: psignal.c /usr/include/signal.h -qsort.o: qsort.c -random.o: random.c /usr/include/stdio.h -readdir.o: readdir.c /usr/include/sys/param.h /usr/include/machine/machparam.h -readdir.o: /usr/include/signal.h /usr/include/sys/types.h -readdir.o: /usr/include/sys/dir.h -regex.o: regex.c -scandir.o: scandir.c /usr/include/sys/types.h /usr/include/sys/stat.h -scandir.o: /usr/include/sys/dir.h -seekdir.o: seekdir.c /usr/include/sys/param.h /usr/include/machine/machparam.h -seekdir.o: /usr/include/signal.h /usr/include/sys/types.h -seekdir.o: /usr/include/sys/dir.h -setgid.o: setgid.c -setegid.o: setegid.c -setrgid.o: setrgid.c -setuid.o: setuid.c -seteuid.o: seteuid.c -setruid.o: setruid.c -siglist.o: siglist.c /usr/include/signal.h -signal.o: signal.c /usr/include/signal.h -siginterrupt.o: siginterrupt.c /usr/include/signal.h -sleep.o: sleep.c /usr/include/sys/time.h /usr/include/time.h -sleep.o: /usr/include/signal.h -swab.o: swab.c -syslog.o: syslog.c /usr/include/sys/types.h /usr/include/sys/socket.h -syslog.o: /usr/include/sys/file.h /usr/include/sys/signal.h -syslog.o: /usr/include/sys/syslog.h /usr/include/netdb.h /usr/include/strings.h -system.o: system.c /usr/include/signal.h -telldir.o: telldir.c /usr/include/sys/param.h /usr/include/machine/machparam.h -telldir.o: /usr/include/signal.h /usr/include/sys/types.h -telldir.o: /usr/include/sys/dir.h -time.o: time.c /usr/include/sys/types.h /usr/include/sys/time.h -time.o: /usr/include/time.h -timezone.o: timezone.c -ttyname.o: ttyname.c /usr/include/sys/param.h /usr/include/machine/machparam.h -ttyname.o: /usr/include/signal.h /usr/include/sys/types.h -ttyname.o: /usr/include/sys/dir.h /usr/include/sys/stat.h -ttyslot.o: ttyslot.c /usr/include/ttyent.h -ualarm.o: ualarm.c /usr/include/sys/time.h /usr/include/time.h -usleep.o: usleep.c /usr/include/sys/time.h /usr/include/time.h -usleep.o: /usr/include/signal.h -valloc.o: valloc.c -# DEPENDENCIES MUST END AT END OF FILE -# IF YOU PUT STUFF HERE IT WILL GO AWAY -# see make depend above diff --git a/lib/libc/gen/_setjmp.c b/lib/libc/gen/_setjmp.c new file mode 100644 index 0000000..f4be53d --- /dev/null +++ b/lib/libc/gen/_setjmp.c @@ -0,0 +1,10 @@ +#include + +int _setjmp(e) jmp_buf e; { + write(2, "_setjmp()\n", 10); + abort(); +} +void _longjmp(e, v) jmp_buf e; { + write(2, "_longjmp()\n", 11); + abort(); +} diff --git a/lib/libc/gen/abs.c b/lib/libc/gen/abs.c new file mode 100644 index 0000000..0988e86 --- /dev/null +++ b/lib/libc/gen/abs.c @@ -0,0 +1,4 @@ +int abs(i) int i; { + write(2, "abs()\n", 6); + abort(); +} diff --git a/lib/libc/gen/atof.c b/lib/libc/gen/atof.c new file mode 100644 index 0000000..1516cf5 --- /dev/null +++ b/lib/libc/gen/atof.c @@ -0,0 +1,4 @@ +double atof(s) char *s; { + write(2, "atof()\n", 7); + abort(); +} diff --git a/lib/libc/gen/bcmp.c b/lib/libc/gen/bcmp.c new file mode 100644 index 0000000..c98c535 --- /dev/null +++ b/lib/libc/gen/bcmp.c @@ -0,0 +1,29 @@ +/* + * Copyright (c) 1987 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)bcmp.c 5.1 (Berkeley) 1/27/87"; +#endif LIBC_SCCS and not lint + +/* + * bcmp -- vax cmpc3 instruction + */ +bcmp(_b1, _b2, length) + void *_b1, *_b2; + register int length; +{ +#define b1 (*(char **)&_b1) +#define b2 (*(char **)&_b2) + if (length == 0) + return (0); + do + if (*b1++ != *b2++) + break; + while (--length); + return(length); +#undef b1 +#undef b2 +} diff --git a/lib/libc/gen/bcopy.c b/lib/libc/gen/bcopy.c new file mode 100644 index 0000000..503440f --- /dev/null +++ b/lib/libc/gen/bcopy.c @@ -0,0 +1,49 @@ +/* + * Copyright (c) 1987 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)bcopy.c 5.1 (Berkeley) 1/27/87"; +#endif LIBC_SCCS and not lint + +/* + * bcopy -- vax movc3 instruction + */ +bcopy(_src, _dst, length) + void *_src, *_dst; + register int length; +{ +#define src (*(char **)&_src) +#define dst (*(char **)&_dst) + if (length && src != dst) + if ((u_int)dst < (u_int)src) + if (((int)src | (int)dst | length) & 3) + do /* copy by bytes */ + *dst++ = *src++; + while (--length); + else { + length >>= 2; + do /* copy by longs */ + *(*(long **)&dst)++ = *(*(long **)&src)++; + while (--length); + } + else { /* copy backwards */ + src += length; + dst += length; + if (((int)src | (int)dst | length) & 3) + do /* copy by bytes */ + *--dst = *--src; + while (--length); + else { + length >>= 2; + do /* copy by shorts */ + *--(*(long **)&dst) = *--(*(long **)&src); + while (--length); + } + } + return(0); +#undef src +#undef dst +} diff --git a/lib/libc/gen/bzero.c b/lib/libc/gen/bzero.c new file mode 100644 index 0000000..6a7c786 --- /dev/null +++ b/lib/libc/gen/bzero.c @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1987 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)bzero.c 5.1 (Berkeley) 1/27/87"; +#endif LIBC_SCCS and not lint + +/* + * bzero -- vax movc5 instruction + */ +bzero(_b, length) + void *_b; + register int length; +{ +#define b (*(char **)&_b) + if (length) + do + *b++ = '\0'; + while (--length); + return(length); +#undef b +} diff --git a/lib/libc/gen/calloc.c b/lib/libc/gen/calloc.c index 20e5422..5c5ac2a 100644 --- a/lib/libc/gen/calloc.c +++ b/lib/libc/gen/calloc.c @@ -5,12 +5,12 @@ static char sccsid[] = "@(#)calloc.c 5.2 (Berkeley) 3/9/86"; /* * Calloc - allocate and clear memory block */ -char * +void * calloc(num, size) register unsigned num, size; { - extern char *malloc(); - register char *p; + extern void *malloc(); + register void *p; size *= num; if (p = malloc(size)) @@ -19,7 +19,7 @@ calloc(num, size) } cfree(p, num, size) - char *p; + void *p; unsigned num; unsigned size; { diff --git a/lib/libc/gen/disktab.c b/lib/libc/gen/disktab.c new file mode 100644 index 0000000..4546c53 --- /dev/null +++ b/lib/libc/gen/disktab.c @@ -0,0 +1,301 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)disktab.c 5.3 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +#include +#include + +static char *dgetstr(); + +struct disktab * +getdiskbyname(name) + char *name; +{ + static struct disktab disk; + static char localbuf[100], *cp = localbuf; + register struct disktab *dp = &disk; + register struct partition *pp; + char p, psize[3], pbsize[3], pfsize[3]; + char buf[BUFSIZ]; + + if (dgetent(buf, name) <= 0) + return ((struct disktab *)0); + dp->d_name = cp; + strcpy(cp, name); + cp += strlen(name) + 1; + dp->d_type = dgetstr("ty", &cp); + dp->d_secsize = dgetnum("se"); + if (dp->d_secsize < 0) + dp->d_secsize = 512; + dp->d_ntracks = dgetnum("nt"); + dp->d_nsectors = dgetnum("ns"); + dp->d_ncylinders = dgetnum("nc"); + dp->d_rpm = dgetnum("rm"); + if (dp->d_rpm < 0) + dp->d_rpm = 3600; + dp->d_badsectforw = dgetflag("sf"); + dp->d_sectoffset = dgetflag("so"); + strcpy(psize, "px"); + strcpy(pbsize, "bx"); + strcpy(pfsize, "fx"); + for (p = 'a'; p < 'i'; p++) { + psize[1] = pbsize[1] = pfsize[1] = p; + pp = &dp->d_partitions[p - 'a']; + pp->p_size = dgetnum(psize); + pp->p_bsize = dgetnum(pbsize); + pp->p_fsize = dgetnum(pfsize); + } + return (dp); +} + +#include + +static char *tbuf; +static char *dskip(); +static char *ddecode(); + +/* + * Get an entry for disk name in buffer bp, + * from the diskcap file. Parse is very rudimentary; + * we just notice escaped newlines. + */ +static +dgetent(bp, name) + char *bp, *name; +{ + register char *cp; + register int c; + register int i = 0, cnt = 0; + char ibuf[BUFSIZ]; + int tf; + + tbuf = bp; + tf = open(DISKTAB, 0); + if (tf < 0) + return (-1); + for (;;) { + cp = bp; + for (;;) { + if (i == cnt) { + cnt = read(tf, ibuf, BUFSIZ); + if (cnt <= 0) { + close(tf); + return (0); + } + i = 0; + } + c = ibuf[i++]; + if (c == '\n') { + if (cp > bp && cp[-1] == '\\'){ + cp--; + continue; + } + break; + } + if (cp >= bp+BUFSIZ) { + write(2,"Disktab entry too long\n", 23); + break; + } else + *cp++ = c; + } + *cp = 0; + + /* + * The real work for the match. + */ + if (dnamatch(name)) { + close(tf); + return (1); + } + } +} + +/* + * Dnamatch deals with name matching. The first field of the disktab + * entry is a sequence of names separated by |'s, so we compare + * against each such name. The normal : terminator after the last + * name (before the first field) stops us. + */ +static +dnamatch(np) + char *np; +{ + register char *Np, *Bp; + + Bp = tbuf; + if (*Bp == '#') + return (0); + for (;;) { + for (Np = np; *Np && *Bp == *Np; Bp++, Np++) + continue; + if (*Np == 0 && (*Bp == '|' || *Bp == ':' || *Bp == 0)) + return (1); + while (*Bp && *Bp != ':' && *Bp != '|') + Bp++; + if (*Bp == 0 || *Bp == ':') + return (0); + Bp++; + } +} + +/* + * Skip to the next field. Notice that this is very dumb, not + * knowing about \: escapes or any such. If necessary, :'s can be put + * into the diskcap file in octal. + */ +static char * +dskip(bp) + register char *bp; +{ + + while (*bp && *bp != ':') + bp++; + if (*bp == ':') + bp++; + return (bp); +} + +/* + * Return the (numeric) option id. + * Numeric options look like + * li#80 + * i.e. the option string is separated from the numeric value by + * a # character. If the option is not found we return -1. + * Note that we handle octal numbers beginning with 0. + */ +static +dgetnum(id) + char *id; +{ + register int i, base; + register char *bp = tbuf; + + for (;;) { + bp = dskip(bp); + if (*bp == 0) + return (-1); + if (*bp++ != id[0] || *bp == 0 || *bp++ != id[1]) + continue; + if (*bp == '@') + return (-1); + if (*bp != '#') + continue; + bp++; + base = 10; + if (*bp == '0') + base = 8; + i = 0; + while (isdigit(*bp)) + i *= base, i += *bp++ - '0'; + return (i); + } +} + +/* + * Handle a flag option. + * Flag options are given "naked", i.e. followed by a : or the end + * of the buffer. Return 1 if we find the option, or 0 if it is + * not given. + */ +static +dgetflag(id) + char *id; +{ + register char *bp = tbuf; + + for (;;) { + bp = dskip(bp); + if (!*bp) + return (0); + if (*bp++ == id[0] && *bp != 0 && *bp++ == id[1]) { + if (!*bp || *bp == ':') + return (1); + else if (*bp == '@') + return (0); + } + } +} + +/* + * Get a string valued option. + * These are given as + * cl=^Z + * Much decoding is done on the strings, and the strings are + * placed in area, which is a ref parameter which is updated. + * No checking on area overflow. + */ +static char * +dgetstr(id, area) + char *id, **area; +{ + register char *bp = tbuf; + + for (;;) { + bp = dskip(bp); + if (!*bp) + return (0); + if (*bp++ != id[0] || *bp == 0 || *bp++ != id[1]) + continue; + if (*bp == '@') + return (0); + if (*bp != '=') + continue; + bp++; + return (ddecode(bp, area)); + } +} + +/* + * Tdecode does the grung work to decode the + * string capability escapes. + */ +static char * +ddecode(str, area) + register char *str; + char **area; +{ + register char *cp; + register int c; + register char *dp; + int i; + + cp = *area; + while ((c = *str++) && c != ':') { + switch (c) { + + case '^': + c = *str++ & 037; + break; + + case '\\': + dp = "E\033^^\\\\::n\nr\rt\tb\bf\f"; + c = *str++; +nextc: + if (*dp++ == c) { + c = *dp++; + break; + } + dp++; + if (*dp) + goto nextc; + if (isdigit(c)) { + c -= '0', i = 2; + do + c <<= 3, c |= *str++ - '0'; + while (--i && isdigit(*str)); + } + break; + } + *cp++ = c; + } + *cp++ = 0; + str = *area; + *area = cp; + return (str); +} diff --git a/lib/libc/gen/ecvt.c b/lib/libc/gen/ecvt.c new file mode 100644 index 0000000..fd84d3b --- /dev/null +++ b/lib/libc/gen/ecvt.c @@ -0,0 +1,108 @@ +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)ecvt.c 5.1 (Berkeley) 3/15/86"; +#endif LIBC_SCCS and not lint + +/* + * ecvt converts to decimal + * the number of digits is specified by ndigit + * decpt is set to the position of the decimal point + * sign is set to 0 for positive, 1 for negative + */ + +char *cvt(); + +#define NDIG 80 +char* +ecvt(arg, ndigits, decpt, sign) +double arg; +int ndigits, *decpt, *sign; +{ + return(cvt(arg, ndigits, decpt, sign, 1)); +} + +char* +fcvt(arg, ndigits, decpt, sign) +double arg; +int ndigits, *decpt, *sign; +{ + return(cvt(arg, ndigits, decpt, sign, 0)); +} + +static char* +cvt(arg, ndigits, decpt, sign, eflag) +double arg; +int ndigits, *decpt, *sign; +{ + register int r2; + double fi, fj; + register char *p, *p1; + static char buf[NDIG]; + double modf(); + + if (ndigits<0) + ndigits = 0; + if (ndigits>=NDIG-1) + ndigits = NDIG-2; + r2 = 0; + *sign = 0; + p = &buf[0]; + if (arg<0) { + *sign = 1; + arg = -arg; + } + arg = modf(arg, &fi); + p1 = &buf[NDIG]; + /* + * Do integer part + */ + if (fi != 0) { + p1 = &buf[NDIG]; + while (fi != 0) { + fj = modf(fi/10, &fi); + *--p1 = (int)((fj+.03)*10) + '0'; + r2++; + } + while (p1 < &buf[NDIG]) + *p++ = *p1++; + } else if (arg > 0) { + while ((fj = arg*10) < 1) { + arg = fj; + r2--; + } + } + p1 = &buf[ndigits]; + if (eflag==0) + p1 += r2; + *decpt = r2; + if (p1 < &buf[0]) { + buf[0] = '\0'; + return(buf); + } + while (p<=p1 && p<&buf[NDIG]) { + arg *= 10; + arg = modf(arg, &fj); + *p++ = (int)fj + '0'; + } + if (p1 >= &buf[NDIG]) { + buf[NDIG-1] = '\0'; + return(buf); + } + p = p1; + *p1 += 5; + while (*p1 > '9') { + *p1 = '0'; + if (p1>buf) + ++*--p1; + else { + *p1 = '1'; + (*decpt)++; + if (eflag==0) { + if (p>buf) + *p = '0'; + p++; + } + } + } + *p = '\0'; + return(buf); +} diff --git a/lib/libc/gen/fakcu.c b/lib/libc/gen/fakcu.c index f69e296..e737ba2 100644 --- a/lib/libc/gen/fakcu.c +++ b/lib/libc/gen/fakcu.c @@ -6,6 +6,7 @@ static char sccsid[] = "@(#)fakcu.c 5.2 (Berkeley) 3/9/86"; * Null cleanup routine to resolve reference in exit() * if not using stdio. */ +void _cleanup() { } diff --git a/lib/libc/gen/ffs.c b/lib/libc/gen/ffs.c new file mode 100644 index 0000000..9cdd64b --- /dev/null +++ b/lib/libc/gen/ffs.c @@ -0,0 +1,35 @@ +/* + * Copyright (c) 1987 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)ffs.c 5.2 (Berkeley) 6/27/88"; +#endif /* LIBC_SCCS and not lint */ + +/* + * ffs -- vax ffs instruction + */ +ffs(mask) + register long mask; +{ + register int cnt; + + if (mask == 0) + return(0); + for (cnt = 1; !(mask & 1); cnt++) + mask >>= 1; + return(cnt); +} diff --git a/lib/libc/gen/getpass.c b/lib/libc/gen/getpass.c index 8142fdf..a782812 100644 --- a/lib/libc/gen/getpass.c +++ b/lib/libc/gen/getpass.c @@ -16,8 +16,8 @@ char *prompt; register c; FILE *fi; static char pbuf[9]; - int (*signal())(); - int (*sig)(); + void (*signal())(); + void (*sig)(); if ((fi = fdopen(open("/dev/tty", 2), "r")) == NULL) fi = stdin; diff --git a/lib/libc/gen/getusershell.c b/lib/libc/gen/getusershell.c index f9fe9ae..24258e7 100644 --- a/lib/libc/gen/getusershell.c +++ b/lib/libc/gen/getusershell.c @@ -66,7 +66,7 @@ initshells() register char **sp, *cp; register FILE *fp; struct stat statb; - extern char *malloc(), *calloc(); + extern void *malloc(), *calloc(); if (shells != NULL) free((char *)shells); @@ -80,7 +80,7 @@ initshells() (void)fclose(fp); return(okshells); } - if ((strings = malloc((unsigned)statb.st_size)) == NULL) { + if ((strings = (char *)malloc((unsigned)statb.st_size)) == NULL) { (void)fclose(fp); return(okshells); } diff --git a/lib/libc/gen/insque.c b/lib/libc/gen/insque.c new file mode 100644 index 0000000..9ea7b25 --- /dev/null +++ b/lib/libc/gen/insque.c @@ -0,0 +1,32 @@ +/* + * Copyright (c) 1987 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)insque.c 5.1 (Berkeley) 1/27/87"; +#endif LIBC_SCCS and not lint + +#include + +/* + * insque -- vax insque instruction + * + * NOTE: this implementation is non-atomic!! + */ + +/* moved this to gen.h as it's shared by caller and by remque.c */ +/*struct vaxque {*/ /* queue format expected by VAX queue instructions */ +/* struct vaxque *vq_next;*/ +/* struct vaxque *vq_prev;*/ +/*};*/ + +insque(e, prev) + register struct vaxque *e, *prev; +{ + e->vq_prev = prev; + e->vq_next = prev->vq_next; + prev->vq_next->vq_prev = e; + prev->vq_next = e; +} diff --git a/lib/libc/gen/ldexp.c b/lib/libc/gen/ldexp.c new file mode 100644 index 0000000..c94cfdf --- /dev/null +++ b/lib/libc/gen/ldexp.c @@ -0,0 +1,4 @@ +double ldexp(v, e) double v; { + write(2, "ldexp()\n", 8); + abort(); +} diff --git a/lib/libc/gen/malloc.c b/lib/libc/gen/malloc.c index 4d200ed..27bb9b4 100644 --- a/lib/libc/gen/malloc.c +++ b/lib/libc/gen/malloc.c @@ -82,7 +82,7 @@ static u_int nmalloc[NBUCKETS]; #if defined(DEBUG) || defined(RCHECK) #define ASSERT(p) if (!(p)) botch("p") #include -static +static void botch(s) char *s; { @@ -94,7 +94,7 @@ botch(s) #define ASSERT(p) #endif -char * +void * malloc(nbytes) unsigned nbytes; { @@ -179,6 +179,7 @@ malloc(nbytes) /* * Allocate more memory to the indicated bucket. */ +void morecore(bucket) int bucket; { @@ -220,9 +221,10 @@ morecore(bucket) } } +void free(cp) - char *cp; -{ + void *cp; +{ register int size; register union overhead *op; @@ -261,11 +263,11 @@ free(cp) */ int realloc_srchlen = 4; /* 4 should be plenty, -1 =>'s whole list */ -char * +void * realloc(cp, nbytes) - char *cp; + void *cp; unsigned nbytes; -{ +{ register u_int onb, i; union overhead *op; char *res; @@ -358,6 +360,7 @@ findbucket(freep, srchlen) * for each size category, the second showing the number of mallocs - * frees for each size category. */ +void mstats(s) char *s; { diff --git a/lib/libc/gen/modf.c b/lib/libc/gen/modf.c new file mode 100644 index 0000000..babd583 --- /dev/null +++ b/lib/libc/gen/modf.c @@ -0,0 +1,4 @@ +double modf(v, p) double v, *p; { + write(2, "modf()\n", 7); + abort(); +} diff --git a/lib/libc/gen/ndbm.c b/lib/libc/gen/ndbm.c index 5bf670f..4db66f0 100644 --- a/lib/libc/gen/ndbm.c +++ b/lib/libc/gen/ndbm.c @@ -14,6 +14,7 @@ static char sccsid[] = "@(#)ndbm.c 5.3 (Berkeley) 3/9/86"; #include #include #include +#include #define BYTESIZ 8 #undef setbit @@ -24,10 +25,12 @@ static long dcalchash(); extern int errno; DBM * -dbm_open(file, flags, mode) +dbm_open(file, flags, va_alist) char *file; - int flags, mode; + int flags; + va_dcl { + va_list argp; struct stat statb; register DBM *db; @@ -40,12 +43,16 @@ dbm_open(file, flags, mode) flags = (flags & ~03) | O_RDWR; strcpy(db->dbm_pagbuf, file); strcat(db->dbm_pagbuf, ".pag"); - db->dbm_pagf = open(db->dbm_pagbuf, flags, mode); + va_start(argp); + db->dbm_pagf = vopen(db->dbm_pagbuf, flags, argp); + va_end(argp); if (db->dbm_pagf < 0) goto bad; strcpy(db->dbm_pagbuf, file); strcat(db->dbm_pagbuf, ".dir"); - db->dbm_dirf = open(db->dbm_pagbuf, flags, mode); + va_start(argp); + db->dbm_dirf = vopen(db->dbm_pagbuf, flags, argp); + va_end(argp); if (db->dbm_dirf < 0) goto bad1; fstat(db->dbm_dirf, &statb); diff --git a/lib/libc/gen/perror.c b/lib/libc/gen/perror.c index c3bec72..9742026 100644 --- a/lib/libc/gen/perror.c +++ b/lib/libc/gen/perror.c @@ -17,7 +17,7 @@ static char sccsid[] = "@(#)perror.c 5.2 (Berkeley) 3/9/86"; int errno; int sys_nerr; -char *sys_errlist[]; +extern char *sys_errlist[]; perror(s) char *s; { diff --git a/lib/libc/gen/qsort.c b/lib/libc/gen/qsort.c index 4e85c94..539bc41 100644 --- a/lib/libc/gen/qsort.c +++ b/lib/libc/gen/qsort.c @@ -32,12 +32,14 @@ static int mthresh; /* MTHRESHold in chars */ * It's not... */ -qsort(base, n, size, compar) - char *base; +void +qsort(_base, n, size, compar) + void *_base; int n; int size; int (*compar)(); { +#define base ((char *)_base) register char c, *i, *j, *lo, *hi; char *min, *max; @@ -90,6 +92,7 @@ qsort(base, n, size, compar) } } } +#undef base } /* @@ -107,10 +110,9 @@ qsort(base, n, size, compar) * (And there are only three places where this is done). */ -static +static void qst(base, max) - char *base, *max; -{ + char *base, *max; { register char c, *i, *j, *jj; register int ii; char *mid, *tmp; diff --git a/lib/libc/gen/random.c b/lib/libc/gen/random.c index d8cdd9e..0f3c08a 100644 --- a/lib/libc/gen/random.c +++ b/lib/libc/gen/random.c @@ -224,7 +224,7 @@ initstate( seed, arg_state, n ) if( n < BREAK_1 ) { if( n < BREAK_0 ) { fprintf( stderr, "initstate: not enough state (%d bytes) with which to do jack; ignored.\n" ); - return; + return( ostate ); } rand_type = TYPE_0; rand_deg = DEG_0; diff --git a/lib/libc/gen/regex.c b/lib/libc/gen/regex.c index 73c1e0c..75c7146 100644 --- a/lib/libc/gen/regex.c +++ b/lib/libc/gen/regex.c @@ -8,8 +8,6 @@ static char sccsid[] = "@(#)regex.c 5.2 (Berkeley) 3/9/86"; #endif LIBC_SCCS and not lint -# - /* * routines to do regular expression matching * diff --git a/lib/libc/gen/remque.c b/lib/libc/gen/remque.c new file mode 100644 index 0000000..afd76e4 --- /dev/null +++ b/lib/libc/gen/remque.c @@ -0,0 +1,30 @@ +/* + * Copyright (c) 1987 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)remque.c 5.1 (Berkeley) 1/27/87"; +#endif LIBC_SCCS and not lint + +#include + +/* + * remque -- vax remque instruction + * + * NOTE: this implementation is non-atomic!! + */ + +/* moved this to gen.h as it's shared by caller and by remque.c */ +/*struct vaxque {*/ /* queue format expected by VAX queue instructions */ +/* struct vaxque *vq_next;*/ +/* struct vaxque *vq_prev;*/ +/*};*/ + +remque(e) + register struct vaxque *e; +{ + e->vq_prev->vq_next = e->vq_next; + e->vq_next->vq_prev = e->vq_prev; +} diff --git a/lib/libc/gen/setjmp.c b/lib/libc/gen/setjmp.c new file mode 100644 index 0000000..7bc584e --- /dev/null +++ b/lib/libc/gen/setjmp.c @@ -0,0 +1,10 @@ +#include + +int setjmp(e) jmp_buf e; { + write(2, "setjmp()\n", 9); + abort(); +} +void longjmp(e, v) jmp_buf e; { + write(2, "longjmp()\n", 10); + abort(); +} diff --git a/lib/libc/gen/setjmperr.c b/lib/libc/gen/setjmperr.c new file mode 100644 index 0000000..d46b7a6 --- /dev/null +++ b/lib/libc/gen/setjmperr.c @@ -0,0 +1,23 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)setjmperr.c 5.2 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +#define ERRMSG "longjmp botch\n" + +/* + * This routine is called from longjmp() when an error occurs. + * Programs that wish to exit gracefully from this error may + * write their own versions. + * If this routine returns, the program is aborted. + */ +longjmperror() +{ + + write(2, ERRMSG, sizeof(ERRMSG)); +} diff --git a/lib/libc/gen/signal.c b/lib/libc/gen/signal.c index 7c0710a..d6bb2cf 100644 --- a/lib/libc/gen/signal.c +++ b/lib/libc/gen/signal.c @@ -13,9 +13,10 @@ static char sccsid[] = "@(#)signal.c 5.2 (Berkeley) 3/9/86"; */ #include -int (* -signal(s, a))() - int s, (*a)(); +void +(*signal(s, a))() + int s; + void (*a)(); { struct sigvec osv, sv; static int mask[NSIG]; diff --git a/lib/libc/gen/sleep.c b/lib/libc/gen/sleep.c index d20389c..f5b7d0b 100644 --- a/lib/libc/gen/sleep.c +++ b/lib/libc/gen/sleep.c @@ -16,10 +16,12 @@ static char sccsid[] = "@(#)sleep.c 5.2 (Berkeley) 3/9/86"; static int ringring; +void sleep(n) unsigned n; { - int sleepx(), omask; + void sleepx(); + int omask; struct itimerval itv, oitv; register struct itimerval *itp = &itv; struct sigvec vec, ovec; @@ -58,9 +60,8 @@ sleep(n) (void) setitimer(ITIMER_REAL, &oitv, (struct itimerval *)0); } -static +static void sleepx() { - ringring = 1; } diff --git a/lib/libc/gen/syslog.c b/lib/libc/gen/syslog.c index f0dcc80..075eb89 100644 --- a/lib/libc/gen/syslog.c +++ b/lib/libc/gen/syslog.c @@ -32,6 +32,7 @@ static char sccsid[] = "@(#)syslog.c 5.9 (Berkeley) 5/7/86"; #include #include #include +#include #define MAXLINE 1024 /* max message size */ #define NULL 0 /* manifest */ @@ -54,14 +55,17 @@ static struct sockaddr SyslogAddr; /* AF_UNIX address of local logger */ extern int errno, sys_nerr; extern char *sys_errlist[]; -syslog(pri, fmt, p0, p1, p2, p3, p4) +void +syslog(pri, fmt, va_alist) int pri; char *fmt; + va_dcl { char buf[MAXLINE + 1], outline[MAXLINE + 1]; register char *b, *f, *o; register int c; long now; + va_list argp; int pid, olderrno = errno; /* see if we should just throw out this message */ @@ -114,7 +118,9 @@ syslog(pri, fmt, p0, p1, p2, p3, p4) } *b++ = '\n'; *b = '\0'; - sprintf(o, buf, p0, p1, p2, p3, p4); + va_start(argp); + vsprintf(o, buf, argp); + va_end(argp); c = strlen(outline); if (c > MAXLINE) c = MAXLINE; @@ -152,6 +158,7 @@ syslog(pri, fmt, p0, p1, p2, p3, p4) * OPENLOG -- open system log */ +void openlog(ident, logstat, logfac) char *ident; int logstat, logfac; @@ -175,9 +182,9 @@ openlog(ident, logstat, logfac) * CLOSELOG -- close the system log */ +void closelog() { - (void) close(LogFile); LogFile = -1; } diff --git a/lib/libc/gen/system.c b/lib/libc/gen/system.c index b8cc181..6303403 100644 --- a/lib/libc/gen/system.c +++ b/lib/libc/gen/system.c @@ -8,7 +8,7 @@ system(s) char *s; { int status, pid, w; - register int (*istat)(), (*qstat)(); + register void (*istat)(), (*qstat)(); if ((pid = vfork()) == 0) { execl("/bin/sh", "sh", "-c", s, 0); diff --git a/lib/libc/gen/usleep.c b/lib/libc/gen/usleep.c index 0c9e6b0..1e4a431 100644 --- a/lib/libc/gen/usleep.c +++ b/lib/libc/gen/usleep.c @@ -19,10 +19,12 @@ static char sccsid[] = "@(#)usleep.c 5.2 (Berkeley) 3/9/86"; static int ringring; +void usleep(n) unsigned n; { - int sleepx(), omask; + void sleepx(); + int omask; struct itimerval itv, oitv; register struct itimerval *itp = &itv; struct sigvec vec, ovec; @@ -61,9 +63,7 @@ usleep(n) (void) setitimer(ITIMER_REAL, &oitv, (struct itimerval *)0); } -static -sleepx() -{ - +static void +sleepx() { ringring = 1; } diff --git a/lib/libc/gen/valloc.c b/lib/libc/gen/valloc.c index 1388d1d..ecd3034 100644 --- a/lib/libc/gen/valloc.c +++ b/lib/libc/gen/valloc.c @@ -8,9 +8,9 @@ static char sccsid[] = "@(#)valloc.c 5.2 (Berkeley) 3/9/86"; #endif LIBC_SCCS and not lint -char *malloc(); +void *malloc(); -char * +void * valloc(i) int i; { diff --git a/lib/libc/inet/Makefile b/lib/libc/inet/Makefile index 39feaf1..34fc6d8 100644 --- a/lib/libc/inet/Makefile +++ b/lib/libc/inet/Makefile @@ -58,14 +58,3 @@ depend: # DO NOT DELETE THIS LINE -- make depend uses it -inet_addr.o: inet_addr.c /usr/include/sys/types.h /usr/include/ctype.h -inet_addr.o: /usr/include/netinet/in.h -inet_network.o: inet_network.c /usr/include/sys/types.h /usr/include/ctype.h -inet_netof.o: inet_netof.c /usr/include/sys/types.h /usr/include/netinet/in.h -inet_ntoa.o: inet_ntoa.c /usr/include/sys/types.h /usr/include/netinet/in.h -inet_lnaof.o: inet_lnaof.c /usr/include/sys/types.h /usr/include/netinet/in.h -inet_makeaddr.o: inet_makeaddr.c /usr/include/sys/types.h -inet_makeaddr.o: /usr/include/netinet/in.h -# DEPENDENCIES MUST END AT END OF FILE -# IF YOU PUT STUFF HERE IT WILL GO AWAY -# see make depend above diff --git a/lib/libc/net/Makefile b/lib/libc/net/Makefile index 1ece853..def2b5c 100644 --- a/lib/libc/net/Makefile +++ b/lib/libc/net/Makefile @@ -63,54 +63,3 @@ depend: # DO NOT DELETE THIS LINE -- make depend uses it -getnetbyaddr.o: getnetbyaddr.c /usr/include/netdb.h -getnetent.o: getnetent.c /usr/include/stdio.h /usr/include/sys/types.h -getnetent.o: /usr/include/sys/socket.h /usr/include/netdb.h -getnetent.o: /usr/include/ctype.h -getnetbyname.o: getnetbyname.c /usr/include/netdb.h -getproto.o: getproto.c /usr/include/netdb.h -getnetbyaddr.o: getnetbyaddr.c /usr/include/netdb.h -getnetent.o: getnetent.c /usr/include/stdio.h /usr/include/sys/types.h -getnetent.o: /usr/include/sys/socket.h /usr/include/netdb.h -getnetent.o: /usr/include/ctype.h -getnetbyname.o: getnetbyname.c /usr/include/netdb.h -getproto.o: getproto.c /usr/include/netdb.h -getprotoent.o: getprotoent.c /usr/include/stdio.h /usr/include/sys/types.h -getprotoent.o: /usr/include/sys/socket.h /usr/include/netdb.h -getprotoent.o: /usr/include/ctype.h -getprotoname.o: getprotoname.c /usr/include/netdb.h -getservent.o: getservent.c /usr/include/stdio.h /usr/include/sys/types.h -getservent.o: /usr/include/sys/socket.h /usr/include/netdb.h -getservent.o: /usr/include/ctype.h -getservbyport.o: getservbyport.c /usr/include/netdb.h -getservbyname.o: getservbyname.c /usr/include/netdb.h -rcmd.o: rcmd.c /usr/include/stdio.h /usr/include/ctype.h /usr/include/pwd.h -rcmd.o: /usr/include/sys/param.h /usr/include/machine/machparam.h -rcmd.o: /usr/include/signal.h /usr/include/sys/types.h -rcmd.o: /usr/include/sys/socket.h /usr/include/sys/stat.h -rcmd.o: /usr/include/netinet/in.h /usr/include/netdb.h /usr/include/errno.h -rexec.o: rexec.c /usr/include/sys/types.h /usr/include/sys/socket.h -rexec.o: /usr/include/netinet/in.h /usr/include/stdio.h /usr/include/netdb.h -rexec.o: /usr/include/errno.h -ruserpass.o: ruserpass.c /usr/include/stdio.h /usr/include/utmp.h -ruserpass.o: /usr/include/ctype.h /usr/include/sys/types.h -ruserpass.o: /usr/include/sys/stat.h /usr/include/errno.h -res_comp.o: res_comp.c /usr/include/sys/types.h /usr/include/stdio.h -res_comp.o: /usr/include/arpa/nameser.h -res_debug.o: res_debug.c /usr/include/sys/types.h /usr/include/netinet/in.h -res_debug.o: /usr/include/stdio.h /usr/include/arpa/nameser.h -res_init.o: res_init.c /usr/include/sys/types.h /usr/include/sys/socket.h -res_init.o: /usr/include/netinet/in.h /usr/include/stdio.h -res_init.o: /usr/include/arpa/nameser.h /usr/include/resolv.h -res_mkquery.o: res_mkquery.c /usr/include/stdio.h /usr/include/sys/types.h -res_mkquery.o: /usr/include/netinet/in.h /usr/include/arpa/nameser.h -res_mkquery.o: /usr/include/resolv.h -res_send.o: res_send.c /usr/include/sys/param.h -res_send.o: /usr/include/machine/machparam.h /usr/include/signal.h -res_send.o: /usr/include/sys/types.h /usr/include/sys/time.h -res_send.o: /usr/include/time.h /usr/include/sys/socket.h -res_send.o: /usr/include/netinet/in.h /usr/include/stdio.h /usr/include/errno.h -res_send.o: /usr/include/arpa/nameser.h /usr/include/resolv.h -# DEPENDENCIES MUST END AT END OF FILE -# IF YOU PUT STUFF HERE IT WILL GO AWAY -# see make depend above diff --git a/lib/libc/net/hosttable/Makefile b/lib/libc/net/hosttable/Makefile index 60d43e3..5d9aad6 100644 --- a/lib/libc/net/hosttable/Makefile +++ b/lib/libc/net/hosttable/Makefile @@ -54,11 +54,3 @@ depend: # DO NOT DELETE THIS LINE -- make depend uses it -gethostnamadr.o: gethostnamadr.c /usr/include/stdio.h /usr/include/netdb.h -gethostnamadr.o: /usr/include/sys/file.h /usr/include/ndbm.h -gethostent.o: gethostent.c /usr/include/stdio.h /usr/include/sys/types.h -gethostent.o: /usr/include/sys/socket.h /usr/include/netdb.h -gethostent.o: /usr/include/ctype.h /usr/include/ndbm.h -# DEPENDENCIES MUST END AT END OF FILE -# IF YOU PUT STUFF HERE IT WILL GO AWAY -# see make depend above diff --git a/lib/libc/net/htonl.c b/lib/libc/net/htonl.c new file mode 100644 index 0000000..1e2d219 --- /dev/null +++ b/lib/libc/net/htonl.c @@ -0,0 +1,7 @@ +#include +#include + +u_long htonl(hostlong) u_long hostlong; { + write(2, "htonl()\n", 8); + abort(); +} diff --git a/lib/libc/net/htons.c b/lib/libc/net/htons.c new file mode 100644 index 0000000..1a33707 --- /dev/null +++ b/lib/libc/net/htons.c @@ -0,0 +1,7 @@ +#include +#include + +u_short htons(hostshort) u_short hostshort; { + write(2, "htons()\n", 8); + abort(); +} diff --git a/lib/libc/net/named/Makefile b/lib/libc/net/named/Makefile index 8f86f10..6958409 100644 --- a/lib/libc/net/named/Makefile +++ b/lib/libc/net/named/Makefile @@ -57,14 +57,3 @@ depend: # DO NOT DELETE THIS LINE -- make depend uses it -gethostnamadr.o: gethostnamadr.c /usr/include/sys/param.h -gethostnamadr.o: /usr/include/machine/machparam.h /usr/include/signal.h -gethostnamadr.o: /usr/include/sys/types.h /usr/include/sys/socket.h -gethostnamadr.o: /usr/include/netinet/in.h /usr/include/sys/types.h -gethostnamadr.o: /usr/include/ctype.h /usr/include/netdb.h /usr/include/stdio.h -gethostnamadr.o: /usr/include/errno.h /usr/include/arpa/nameser.h -gethostnamadr.o: /usr/include/resolv.h -sethostent.o: sethostent.c -# DEPENDENCIES MUST END AT END OF FILE -# IF YOU PUT STUFF HERE IT WILL GO AWAY -# see make depend above diff --git a/lib/libc/net/ntohl.c b/lib/libc/net/ntohl.c new file mode 100644 index 0000000..5c0c36e --- /dev/null +++ b/lib/libc/net/ntohl.c @@ -0,0 +1,7 @@ +#include +#include + +u_long ntohl(netlong) u_long netlong; { + write(2, "ntohl()\n", 8); + abort(); +} diff --git a/lib/libc/net/ntohs.c b/lib/libc/net/ntohs.c new file mode 100644 index 0000000..80e0941 --- /dev/null +++ b/lib/libc/net/ntohs.c @@ -0,0 +1,7 @@ +#include +#include + +u_short ntohs(netshort) u_short netshort; { + write(2, "ntohs()\n", 8); + abort(); +} diff --git a/lib/libc/net/rcmd.c b/lib/libc/net/rcmd.c index 7dc8baa..d35b25b 100644 --- a/lib/libc/net/rcmd.c +++ b/lib/libc/net/rcmd.c @@ -59,7 +59,7 @@ rcmd(ahost, rport, locuser, remuser, cmd, fd2p) sin.sin_family = hp->h_addrtype; bcopy(hp->h_addr_list[0], (caddr_t)&sin.sin_addr, hp->h_length); sin.sin_port = rport; - if (connect(s, (caddr_t)&sin, sizeof (sin), 0) >= 0) + if (connect(s, (struct sockaddr *)&sin, sizeof (sin)/*, 0*/) >= 0) break; (void) close(s); if (errno == EADDRINUSE) { @@ -107,7 +107,7 @@ rcmd(ahost, rport, locuser, remuser, cmd, fd2p) (void) close(s2); goto bad; } - s3 = accept(s2, &from, &len, 0); + s3 = accept(s2, (struct sockaddr *)&from, &len/*, 0*/); (void) close(s2); if (s3 < 0) { perror("accept"); @@ -162,7 +162,7 @@ rresvport(alport) return (-1); for (;;) { sin.sin_port = htons((u_short)*alport); - if (bind(s, (caddr_t)&sin, sizeof (sin)) >= 0) + if (bind(s, (struct sockaddr *)&sin, sizeof (sin)) >= 0) return (s); if (errno != EADDRINUSE) { (void) close(s); diff --git a/lib/libc/net/res_debug.c b/lib/libc/net/res_debug.c index f74f97d..1238698 100644 --- a/lib/libc/net/res_debug.c +++ b/lib/libc/net/res_debug.c @@ -328,7 +328,9 @@ p_rr(cp, msg, file) } static char nbuf[20]; -extern char *sprintf(); +/* we have taken the portable sprintf() from 4.3tahoe */ +/*extern char *sprintf();*/ +extern int sprintf(); /* * Return a string for the type @@ -385,7 +387,10 @@ p_type(type) case T_GID: return("GID"); default: - return (sprintf(nbuf, "%d", type)); +/* we have taken the portable sprintf() from 4.3tahoe */ + /*return (sprintf(nbuf, "%d", type));*/ + sprintf(nbuf, "%d", type); + return nbuf; } } @@ -403,6 +408,9 @@ p_class(class) case C_ANY: /* matches any class */ return("ANY"); default: - return (sprintf(nbuf, "%d", class)); +/* we have taken the portable sprintf() from 4.3tahoe */ + /*return (sprintf(nbuf, "%d", class));*/ + sprintf(nbuf, "%d", class); + return nbuf; } } diff --git a/lib/libc/net/res_mkquery.c b/lib/libc/net/res_mkquery.c index 5267cc1..0f0c8b5 100644 --- a/lib/libc/net/res_mkquery.c +++ b/lib/libc/net/res_mkquery.c @@ -14,7 +14,10 @@ static char sccsid[] = "@(#)res_mkquery.c 6.3 (Berkeley) 3/17/86"; #include #include -extern char *sprintf(); +/* we have taken the portable sprintf() from 4.3tahoe */ +/*extern char *sprintf();*/ +extern int sprintf(); + /* * Form all types of queries. @@ -71,7 +74,9 @@ res_mkquery(op, dname, class, type, data, datalen, newrr, buf, buflen) if (res_init() == -1) return(-1); if (_res.defdname[0] != '\0') - dname = sprintf(dnbuf, "%s.%s", dname, _res.defdname); +/* we have taken the portable sprintf() from 4.3tahoe */ + /*dname = sprintf(dnbuf, "%s.%s", dname, _res.defdname);*/ + sprintf(dname = dnbuf, "%s.%s", dname, _res.defdname); } /* * perform opcode specific processing diff --git a/lib/libc/net/res_send.c b/lib/libc/net/res_send.c index 4d28a20..8cdd9a2 100644 --- a/lib/libc/net/res_send.c +++ b/lib/libc/net/res_send.c @@ -83,7 +83,7 @@ res_send(buf, buflen, answer, anslen) #endif DEBUG continue; } - if (connect(s, &(_res.nsaddr_list[ns]), + if (connect(s, (struct sockaddr *)&(_res.nsaddr_list[ns]), sizeof(struct sockaddr)) < 0) { terrno = errno; #ifdef DEBUG @@ -157,7 +157,7 @@ res_send(buf, buflen, answer, anslen) if (s < 0) s = socket(AF_INET, SOCK_DGRAM, 0); #if BSD >= 43 - if (connect(s, &_res.nsaddr_list[ns], + if (connect(s, (struct sockaddr *)&_res.nsaddr_list[ns], sizeof(struct sockaddr)) < 0 || send(s, buf, buflen, 0) != buflen) { #ifdef DEBUG diff --git a/lib/libc/net/rexec.c b/lib/libc/net/rexec.c index a8fe781..39198ca 100644 --- a/lib/libc/net/rexec.c +++ b/lib/libc/net/rexec.c @@ -50,7 +50,7 @@ retry: sin.sin_family = hp->h_addrtype; sin.sin_port = rport; bcopy(hp->h_addr, (caddr_t)&sin.sin_addr, hp->h_length); - if (connect(s, &sin, sizeof(sin)) < 0) { + if (connect(s, (struct sockaddr *)&sin, sizeof(sin)) < 0) { if (errno == ECONNREFUSED && timo <= 16) { (void) close(s); sleep(timo); @@ -84,7 +84,7 @@ retry: (void) sprintf(num, "%d", port); (void) write(s, num, strlen(num)+1); { int len = sizeof (from); - s3 = accept(s2, &from, &len, 0); + s3 = accept(s2, (struct sockaddr *)&from, &len/*, 0*/); close(s2); if (s3 < 0) { perror("accept"); diff --git a/lib/libc/net/ruserpass.c b/lib/libc/net/ruserpass.c index 0b30e3f..ad8a2bd 100644 --- a/lib/libc/net/ruserpass.c +++ b/lib/libc/net/ruserpass.c @@ -19,6 +19,7 @@ char *renvlook(), *malloc(), *index(), *getenv(), *getpass(), *getlogin(); struct utmp *getutmp(); static FILE *cfile; +void ruserpass(host, aname, apass) char *host, **aname, **apass; { @@ -46,7 +47,7 @@ ruserpass(host, aname, apass) } } -static +static void renv(host, aname, apass) char *host, **aname, **apass; { @@ -74,8 +75,7 @@ renv(host, aname, apass) mkpwclear(cp, host[0], *apass); } -static -char * +static char * renvlook(host) char *host; { @@ -128,7 +128,7 @@ static struct toktab { 0, 0 }; -static +static void rnetrc(host, aname, apass) char *host, **aname, **apass; { @@ -487,7 +487,7 @@ static char KS[16][48]; * Set up the key schedule from the key. */ -static +static void nbssetkey(key) char *key; { @@ -612,7 +612,7 @@ static char preS[48]; * The payoff: encrypt a block. */ -static +static void blkencrypt(block, edflag) char *block; { @@ -728,7 +728,7 @@ char *sttyname; return(NULL); } -static +static void sreverse(sto, sfrom) register char *sto, *sfrom; { @@ -773,6 +773,7 @@ char *mkenvkey(mch) return (skey); } +void mkpwunclear(spasswd,mch,sencpasswd) char mch, *spasswd, *sencpasswd; { @@ -790,6 +791,7 @@ mkpwunclear(spasswd,mch,sencpasswd) nbsencrypt(spasswd, skey, sencpasswd); } +void mkpwclear(sencpasswd,mch,spasswd) char mch, *spasswd, *sencpasswd; { diff --git a/lib/libc/ns/Makefile b/lib/libc/ns/Makefile index eda3122..d28ab05 100644 --- a/lib/libc/ns/Makefile +++ b/lib/libc/ns/Makefile @@ -54,8 +54,3 @@ depend: # DO NOT DELETE THIS LINE -- make depend uses it -ns_addr.o: ns_addr.c /usr/include/sys/types.h /usr/include/netns/ns.h -ns_ntoa.o: ns_ntoa.c /usr/include/sys/types.h /usr/include/netns/ns.h -# DEPENDENCIES MUST END AT END OF FILE -# IF YOU PUT STUFF HERE IT WILL GO AWAY -# see make depend above diff --git a/lib/libc/ns/ns_addr.c b/lib/libc/ns/ns_addr.c index d5bbea7..0bd83ed 100644 --- a/lib/libc/ns/ns_addr.c +++ b/lib/libc/ns/ns_addr.c @@ -55,7 +55,7 @@ ns_addr(name) socketname = index(hostname, separator); if (socketname) { *socketname++ = 0; - Field(socketname, &addr.x_port, 2); + Field(socketname, (char *)&addr.x_port, 2); } Field(hostname, addr.x_host.c_host, 6); @@ -63,7 +63,7 @@ ns_addr(name) return (addr); } -static +static void Field(buf, out, len) char *buf; u_char *out; diff --git a/lib/libc/stdio/Makefile b/lib/libc/stdio/Makefile index e837cfd..331b111 100644 --- a/lib/libc/stdio/Makefile +++ b/lib/libc/stdio/Makefile @@ -5,35 +5,19 @@ # # @(#)Makefile 5.4 (Berkeley) 9/5/85 # -# Several routines have been rewritten in assembly language for the VAX. -# If you are not running on a VAX, you should use the original C sources -# which are included in this directory. Regretably we do not have a C -# version of doprnt(). -# -#ifndef vax -#SRCS= ${STDSRC} ${VAXSRC} -#OBJS= ${STDOBJ} ${VAXOBJ} -#else -SRCS= ${STDSRC} -OBJS= ${STDOBJ} -#endif not vax - +SRCS= clrerr.c doprnt.c doscan.c exit.c fdopen.c fgetc.c fgets.c filbuf.c \ + findiop.c flsbuf.c fopen.c fprintf.c fputc.c fputs.c fread.c \ + freopen.c fseek.c ftell.c fwrite.c getchar.c gets.c getw.c popen.c \ + printf.c putchar.c puts.c putw.c rew.c scanf.c setbuf.c setbuffer.c \ + sibuf.c sobuf.c sprintf.c strout.c ungetc.c vfprintf.c vprintf.c \ + vsprintf.c +OBJS= clrerr.o doprnt.o doscan.o exit.o fdopen.o fgetc.o fgets.o filbuf.o \ + findiop.o flsbuf.o fopen.o fprintf.o fputc.o fputs.o fread.o \ + freopen.o fseek.o ftell.o fwrite.o getchar.o gets.o getw.o popen.o \ + printf.o putchar.o puts.o putw.o rew.o scanf.o setbuf.o setbuffer.o \ + sibuf.o sobuf.o sprintf.o strout.o ungetc.o vfprintf.o vprintf.o \ + vsprintf.o CFLAGS= -O ${DEFS} - -STDSRC= clrerr.c doscan.c \ - exit.c fdopen.c fgetc.c filbuf.c findiop.c flsbuf.c fopen.c \ - fprintf.c fputc.c fread.c freopen.c fseek.c ftell.c \ - fwrite.c getchar.c getw.c printf.c putchar.c \ - putw.c rew.c scanf.c setbuf.c setbuffer.c sibuf.c sobuf.c \ - sprintf.c strout.c ungetc.c -VAXSRC= fgets.c fputs.c gets.c puts.c -STDOBJ= clrerr.o doscan.o \ - exit.o fdopen.o fgetc.o filbuf.o findiop.o flsbuf.o fopen.o \ - fprintf.o fputc.o fread.o freopen.o fseek.o ftell.o \ - fwrite.o getchar.o getw.o printf.o putchar.o \ - putw.o rew.o scanf.o setbuf.o setbuffer.o sibuf.o sobuf.o \ - sprintf.o strout.o ungetc.o -VAXOBJ= fgets.o fputs.o gets.o puts.o TAGSFILE=tags .c.o: @@ -78,41 +62,3 @@ depend: # DO NOT DELETE THIS LINE -- make depend uses it -clrerr.o: clrerr.c /usr/include/stdio.h -doscan.o: doscan.c /usr/include/stdio.h /usr/include/ctype.h -exit.o: exit.c -fdopen.o: fdopen.c /usr/include/sys/types.h /usr/include/sys/file.h -fdopen.o: /usr/include/stdio.h -fgetc.o: fgetc.c /usr/include/stdio.h -filbuf.o: filbuf.c /usr/include/stdio.h /usr/include/sys/types.h -filbuf.o: /usr/include/sys/stat.h -findiop.o: findiop.c /usr/include/stdio.h -flsbuf.o: flsbuf.c /usr/include/stdio.h /usr/include/sys/types.h -flsbuf.o: /usr/include/sys/stat.h -fopen.o: fopen.c /usr/include/sys/types.h /usr/include/sys/file.h -fopen.o: /usr/include/stdio.h -fprintf.o: fprintf.c /usr/include/stdio.h -fputc.o: fputc.c /usr/include/stdio.h -fread.o: fread.c /usr/include/stdio.h -freopen.o: freopen.c /usr/include/sys/types.h /usr/include/sys/file.h -freopen.o: /usr/include/stdio.h -fseek.o: fseek.c /usr/include/stdio.h -ftell.o: ftell.c /usr/include/stdio.h -fwrite.o: fwrite.c /usr/include/stdio.h -getchar.o: getchar.c /usr/include/stdio.h -getw.o: getw.c /usr/include/stdio.h -printf.o: printf.c /usr/include/stdio.h -putchar.o: putchar.c /usr/include/stdio.h -putw.o: putw.c /usr/include/stdio.h -rew.o: rew.c /usr/include/stdio.h -scanf.o: scanf.c /usr/include/stdio.h -setbuf.o: setbuf.c /usr/include/stdio.h -setbuffer.o: setbuffer.c /usr/include/stdio.h -sibuf.o: sibuf.c /usr/include/stdio.h -sobuf.o: sobuf.c /usr/include/stdio.h -sprintf.o: sprintf.c /usr/include/stdio.h -strout.o: strout.c /usr/include/stdio.h -ungetc.o: ungetc.c /usr/include/stdio.h -# DEPENDENCIES MUST END AT END OF FILE -# IF YOU PUT STUFF HERE IT WILL GO AWAY -# see make depend above diff --git a/lib/libc/stdio/doprnt.c b/lib/libc/stdio/doprnt.c new file mode 100644 index 0000000..3aa00db --- /dev/null +++ b/lib/libc/stdio/doprnt.c @@ -0,0 +1,666 @@ +/* + * Copyright (c) 1988 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)doprnt.c 5.35 (Berkeley) 6/27/88"; +#endif /* LIBC_SCCS and not lint */ + +#include +#include +#include +#include + +/* 11-bit exponent (VAX G floating point) is 308 decimal digits */ +#define MAXEXP 308 +/* 128 bit fraction takes up 39 decimal digits; max reasonable precision */ +#define MAXFRACT 39 + +#define DEFPREC 6 + +#define BUF (MAXEXP+MAXFRACT+1) /* + decimal point */ + +#define PUTC(ch) (void) putc(ch, fp) + +#define ARG() \ + _ulong = flags&LONGINT ? va_arg(argp, long) : \ + flags&SHORTINT ? va_arg(argp, short) : va_arg(argp, int); + +#define todigit(c) ((c) - '0') +#define tochar(n) ((n) + '0') + +/* have to deal with the negative buffer count kludge */ +#define NEGATIVE_COUNT_KLUDGE + +#define LONGINT 0x01 /* long integer */ +#define LONGDBL 0x02 /* long double; unimplemented */ +#define SHORTINT 0x04 /* short integer */ +#define ALT 0x08 /* alternate form */ +#define LADJUST 0x10 /* left adjustment */ +#define ZEROPAD 0x20 /* zero (as opposed to blank) pad */ +#define HEXPREFIX 0x40 /* add 0x or 0X prefix */ + +_doprnt(fmt0, argp, fp) + u_char *fmt0; + va_list argp; + register FILE *fp; +{ + register u_char *fmt; /* format string */ + register int ch; /* character from fmt */ + register int cnt; /* return value accumulator */ + register int n; /* random handy integer */ + register char *t; /* buffer pointer */ + double _double; /* double precision arguments %[eEfgG] */ + u_long _ulong; /* integer arguments %[diouxX] */ + int base; /* base for [diouxX] conversion */ + int dprec; /* decimal precision in [diouxX] */ + int fieldsz; /* field size expanded by sign, etc */ + int flags; /* flags as above */ + int fpprec; /* `extra' floating precision in [eEfgG] */ + int prec; /* precision from format (%.3d), or -1 */ + int realsz; /* field size expanded by decimal precision */ + int size; /* size of converted field or string */ + int width; /* width from format (%8d), or 0 */ + char sign; /* sign prefix (' ', '+', '-', or \0) */ + char softsign; /* temporary negative sign for floats */ + char *digs; /* digits for [diouxX] conversion */ + char buf[BUF]; /* space for %c, %[diouxX], %[eEfgG] */ + + if (fp->_flag & _IORW) { + fp->_flag |= _IOWRT; + fp->_flag &= ~(_IOEOF|_IOREAD); + } + if ((fp->_flag & _IOWRT) == 0) + return (EOF); + + fmt = fmt0; + digs = "0123456789abcdef"; + for (cnt = 0;; ++fmt) { + n = fp->_cnt; + for (t = (char *)fp->_ptr; (ch = *fmt) && ch != '%'; + ++cnt, ++fmt) + if (--n < 0 +#ifdef NEGATIVE_COUNT_KLUDGE + && (!(fp->_flag & _IOLBF) || -n >= fp->_bufsiz) +#endif + || ch == '\n' && fp->_flag & _IOLBF) { + fp->_cnt = n; + fp->_ptr = t; + (void) _flsbuf((u_char)ch, fp); + n = fp->_cnt; + t = (char *)fp->_ptr; + } else + *t++ = ch; + fp->_cnt = n; + fp->_ptr = t; + if (!ch) + return (cnt); + + flags = 0; dprec = 0; fpprec = 0; width = 0; + prec = -1; + sign = '\0'; + +rflag: switch (*++fmt) { + case ' ': + /* + * ``If the space and + flags both appear, the space + * flag will be ignored.'' + * -- ANSI X3J11 + */ + if (!sign) + sign = ' '; + goto rflag; + case '#': + flags |= ALT; + goto rflag; + case '*': + /* + * ``A negative field width argument is taken as a + * - flag followed by a positive field width.'' + * -- ANSI X3J11 + * They don't exclude field widths read from args. + */ + if ((width = va_arg(argp, int)) >= 0) + goto rflag; + width = -width; + /* FALLTHROUGH */ + case '-': + flags |= LADJUST; + goto rflag; + case '+': + sign = '+'; + goto rflag; + case '.': + if (*++fmt == '*') + n = va_arg(argp, int); + else { + n = 0; + while (isascii(*fmt) && isdigit(*fmt)) + n = 10 * n + todigit(*fmt++); + --fmt; + } + prec = n < 0 ? -1 : n; + goto rflag; + case '0': + /* + * ``Note that 0 is taken as a flag, not as the + * beginning of a field width.'' + * -- ANSI X3J11 + */ + flags |= ZEROPAD; + goto rflag; + case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + n = 0; + do { + n = 10 * n + todigit(*fmt); + } while (isascii(*++fmt) && isdigit(*fmt)); + width = n; + --fmt; + goto rflag; + case 'L': + flags |= LONGDBL; + goto rflag; + case 'h': + flags |= SHORTINT; + goto rflag; + case 'l': + flags |= LONGINT; + goto rflag; + case 'c': + *(t = buf) = va_arg(argp, int); + size = 1; + sign = '\0'; + goto pforw; + case 'D': + flags |= LONGINT; + /*FALLTHROUGH*/ + case 'd': + case 'i': + ARG(); + if ((long)_ulong < 0) { + _ulong = -_ulong; + sign = '-'; + } + base = 10; + goto number; + case 'e': + case 'E': + case 'f': + case 'g': + case 'G': + _double = va_arg(argp, double); + /* + * don't do unrealistic precision; just pad it with + * zeroes later, so buffer size stays rational. + */ + if (prec > MAXFRACT) { + if (*fmt != 'g' && *fmt != 'G' || (flags&ALT)) + fpprec = prec - MAXFRACT; + prec = MAXFRACT; + } + else if (prec == -1) + prec = DEFPREC; + /* + * softsign avoids negative 0 if _double is < 0 and + * no significant digits will be shown + */ + if (_double < 0) { + softsign = '-'; + _double = -_double; + } + else + softsign = 0; + /* + * cvt may have to round up past the "start" of the + * buffer, i.e. ``intf("%.2f", (double)9.999);''; + * if the first char isn't NULL, it did. + */ + *buf = NULL; + size = cvt(_double, prec, flags, &softsign, *fmt, buf, + buf + sizeof(buf)); + if (softsign) + sign = '-'; + t = *buf ? buf : buf + 1; + goto pforw; + case 'n': + if (flags & LONGINT) + *va_arg(argp, long *) = cnt; + else if (flags & SHORTINT) + *va_arg(argp, short *) = cnt; + else + *va_arg(argp, int *) = cnt; + break; + case 'O': + flags |= LONGINT; + /*FALLTHROUGH*/ + case 'o': + ARG(); + base = 8; + goto nosign; + case 'p': + /* + * ``The argument shall be a pointer to void. The + * value of the pointer is converted to a sequence + * of printable characters, in an implementation- + * defined manner.'' + * -- ANSI X3J11 + */ + /* NOSTRICT */ + _ulong = (u_long)va_arg(argp, void *); + base = 16; + goto nosign; + case 's': + if (!(t = va_arg(argp, char *))) + t = "(null)"; + if (prec >= 0) { + /* + * can't use strlen; can only look for the + * NUL in the first `prec' characters, and + * strlen() will go further. + */ + char *p; + void *memchr(); + + if (p = (char *)memchr(t, 0, prec)) { + size = p - t; + if (size > prec) + size = prec; + } else + size = prec; + } else + size = strlen(t); + sign = '\0'; + goto pforw; + case 'U': + flags |= LONGINT; + /*FALLTHROUGH*/ + case 'u': + ARG(); + base = 10; + goto nosign; + case 'X': + digs = "0123456789ABCDEF"; + /* FALLTHROUGH */ + case 'x': + ARG(); + base = 16; + /* leading 0x/X only if non-zero */ + if (flags & ALT && _ulong != 0) + flags |= HEXPREFIX; + + /* unsigned conversions */ +nosign: sign = '\0'; + /* + * ``... diouXx conversions ... if a precision is + * specified, the 0 flag will be ignored.'' + * -- ANSI X3J11 + */ +number: if ((dprec = prec) >= 0) + flags &= ~ZEROPAD; + + /* + * ``The result of converting a zero value with an + * explicit precision of zero is no characters.'' + * -- ANSI X3J11 + */ + t = buf + BUF; + if (_ulong != 0 || prec != 0) { + do { + *--t = digs[_ulong % base]; + _ulong /= base; + } while (_ulong); + digs = "0123456789abcdef"; + if (flags & ALT && base == 8 && *t != '0') + *--t = '0'; /* octal leading 0 */ + } + size = buf + BUF - t; + +pforw: + /* + * All reasonable formats wind up here. At this point, + * `t' points to a string which (if not flags&LADJUST) + * should be padded out to `width' places. If + * flags&ZEROPAD, it should first be prefixed by any + * sign or other prefix; otherwise, it should be blank + * padded before the prefix is emitted. After any + * left-hand padding and prefixing, emit zeroes + * required by a decimal [diouxX] precision, then print + * the string proper, then emit zeroes required by any + * leftover floating precision; finally, if LADJUST, + * pad with blanks. + */ + + /* + * compute actual size, so we know how much to pad + * fieldsz excludes decimal prec; realsz includes it + */ + fieldsz = size + fpprec; + if (sign) + fieldsz++; + if (flags & HEXPREFIX) + fieldsz += 2; + realsz = dprec > fieldsz ? dprec : fieldsz; + + /* right-adjusting blank padding */ + if ((flags & (LADJUST|ZEROPAD)) == 0 && width) + for (n = realsz; n < width; n++) + PUTC(' '); + /* prefix */ + if (sign) + PUTC(sign); + if (flags & HEXPREFIX) { + PUTC('0'); + PUTC((char)*fmt); + } + /* right-adjusting zero padding */ + if ((flags & (LADJUST|ZEROPAD)) == ZEROPAD) + for (n = realsz; n < width; n++) + PUTC('0'); + /* leading zeroes from decimal precision */ + for (n = fieldsz; n < dprec; n++) + PUTC('0'); + + /* the string or number proper */ + if (fp->_cnt - (n = size) >= 0 && + (fp->_flag & _IOLBF) == 0) { + fp->_cnt -= n; + bcopy(t, (char *)fp->_ptr, n); + fp->_ptr += n; + } else + while (--n >= 0) + PUTC(*t++); + /* trailing f.p. zeroes */ + while (--fpprec >= 0) + PUTC('0'); + /* left-adjusting padding (always blank) */ + if (flags & LADJUST) + for (n = realsz; n < width; n++) + PUTC(' '); + /* finally, adjust cnt */ + cnt += width > realsz ? width : realsz; + break; + case '\0': /* "%?" prints ?, unless ? is NULL */ + return (cnt); + default: + PUTC((char)*fmt); + cnt++; + } + } + /* NOTREACHED */ +} + +static +cvt(number, prec, flags, signp, fmtch, startp, endp) + double number; + register int prec; + int flags; + u_char fmtch; + char *signp, *startp, *endp; +{ + register char *p, *t; + register double fract; + int dotrim, expcnt, gformat; + double integer, tmp, modf(); + char *exponent(), *round(); + + dotrim = expcnt = gformat = 0; + fract = modf(number, &integer); + + /* get an extra slot for rounding. */ + t = ++startp; + + /* + * get integer portion of number; put into the end of the buffer; the + * .01 is added for modf(356.0 / 10, &integer) returning .59999999... + */ + for (p = endp - 1; integer; ++expcnt) { + tmp = modf(integer / 10, &integer); + *p-- = tochar((int)((tmp + .01) * 10)); + } + switch(fmtch) { + case 'f': + /* reverse integer into beginning of buffer */ + if (expcnt) + for (; ++p < endp; *t++ = *p); + else + *t++ = '0'; + /* + * if precision required or alternate flag set, add in a + * decimal point. + */ + if (prec || flags&ALT) + *t++ = '.'; + /* if requires more precision and some fraction left */ + if (fract) { + if (prec) + do { + fract = modf(fract * 10, &tmp); + *t++ = tochar((int)tmp); + } while (--prec && fract); + if (fract) + startp = round(fract, (int *)NULL, startp, + t - 1, (char)0, signp); + } + for (; prec--; *t++ = '0'); + break; + case 'e': + case 'E': +eformat: if (expcnt) { + *t++ = *++p; + if (prec || flags&ALT) + *t++ = '.'; + /* if requires more precision and some integer left */ + for (; prec && ++p < endp; --prec) + *t++ = *p; + /* + * if done precision and more of the integer component, + * round using it; adjust fract so we don't re-round + * later. + */ + if (!prec && ++p < endp) { + fract = 0; + startp = round((double)0, &expcnt, startp, + t - 1, *p, signp); + } + /* adjust expcnt for digit in front of decimal */ + --expcnt; + } + /* until first fractional digit, decrement exponent */ + else if (fract) { + /* adjust expcnt for digit in front of decimal */ + for (expcnt = -1;; --expcnt) { + fract = modf(fract * 10, &tmp); + if (tmp) + break; + } + *t++ = tochar((int)tmp); + if (prec || flags&ALT) + *t++ = '.'; + } + else { + *t++ = '0'; + if (prec || flags&ALT) + *t++ = '.'; + } + /* if requires more precision and some fraction left */ + if (fract) { + if (prec) + do { + fract = modf(fract * 10, &tmp); + *t++ = tochar((int)tmp); + } while (--prec && fract); + if (fract) + startp = round(fract, &expcnt, startp, + t - 1, (char)0, signp); + } + /* if requires more precision */ + for (; prec--; *t++ = '0'); + + /* unless alternate flag, trim any g/G format trailing 0's */ + if (gformat && !(flags&ALT)) { + while (t > startp && *--t == '0'); + if (*t == '.') + --t; + ++t; + } + t = exponent(t, expcnt, fmtch); + break; + case 'g': + case 'G': + /* a precision of 0 is treated as a precision of 1. */ + if (!prec) + ++prec; + /* + * ``The style used depends on the value converted; style e + * will be used only if the exponent resulting from the + * conversion is less than -4 or greater than the precision.'' + * -- ANSI X3J11 + */ + if (expcnt > prec || !expcnt && fract && fract < .0001) { + /* + * g/G format counts "significant digits, not digits of + * precision; for the e/E format, this just causes an + * off-by-one problem, i.e. g/G considers the digit + * before the decimal point significant and e/E doesn't + * count it as precision. + */ + --prec; + fmtch -= 2; /* G->E, g->e */ + gformat = 1; + goto eformat; + } + /* + * reverse integer into beginning of buffer, + * note, decrement precision + */ + if (expcnt) + for (; ++p < endp; *t++ = *p, --prec); + else + *t++ = '0'; + /* + * if precision required or alternate flag set, add in a + * decimal point. If no digits yet, add in leading 0. + */ + if (prec || flags&ALT) { + dotrim = 1; + *t++ = '.'; + } + else + dotrim = 0; + /* if requires more precision and some fraction left */ + if (fract) { + if (prec) { + do { + fract = modf(fract * 10, &tmp); + *t++ = tochar((int)tmp); + } while(!tmp); + while (--prec && fract) { + fract = modf(fract * 10, &tmp); + *t++ = tochar((int)tmp); + } + } + if (fract) + startp = round(fract, (int *)NULL, startp, + t - 1, (char)0, signp); + } + /* alternate format, adds 0's for precision, else trim 0's */ + if (flags&ALT) + for (; prec--; *t++ = '0'); + else if (dotrim) { + while (t > startp && *--t == '0'); + if (*t != '.') + ++t; + } + } + return(t - startp); +} + +static char * +round(fract, exp, start, end, ch, signp) + double fract; + int *exp; + register char *start, *end; + char ch, *signp; +{ + double tmp; + + if (fract) + (void)modf(fract * 10, &tmp); + else + tmp = todigit(ch); + if (tmp > 4) + for (;; --end) { + if (*end == '.') + --end; + if (++*end <= '9') + break; + *end = '0'; + if (end == start) { + if (exp) { /* e/E; increment exponent */ + *end = '1'; + ++*exp; + } + else { /* f; add extra digit */ + *--end = '1'; + --start; + } + break; + } + } + /* ``"%.3f", (double)-0.0004'' gives you a negative 0. */ + else if (*signp == '-') + for (;; --end) { + if (*end == '.') + --end; + if (*end != '0') + break; + if (end == start) + *signp = 0; + } + return(start); +} + +static char * +exponent(p, exp, fmtch) + register char *p; + register int exp; + u_char fmtch; +{ + register char *t; + char expbuf[MAXEXP]; + + *p++ = fmtch; + if (exp < 0) { + exp = -exp; + *p++ = '-'; + } + else + *p++ = '+'; + t = expbuf + MAXEXP; + if (exp > 9) { + do { + *--t = tochar(exp % 10); + } while ((exp /= 10) > 9); + *--t = tochar(exp); + for (; t < expbuf + MAXEXP; *p++ = *t++); + } + else { + *p++ = '0'; + *p++ = tochar(exp); + } + return(p); +} diff --git a/lib/libc/stdio/doscan.c b/lib/libc/stdio/doscan.c index 85fd7ad..ed2ec05 100644 --- a/lib/libc/stdio/doscan.c +++ b/lib/libc/stdio/doscan.c @@ -3,7 +3,8 @@ static char sccsid[] = "@(#)doscan.c 5.2 (Berkeley) 3/9/86"; #endif LIBC_SCCS and not lint #include -#include +#include +#include #define SPC 01 #define STP 02 @@ -30,11 +31,11 @@ static char _sctab[256] = { _doscan(iop, fmt, argp) FILE *iop; register char *fmt; -register int **argp; +register va_list argp; { register int ch; int nmatch, len, ch1; - int **ptr, fileended, size; + int *ptr, fileended, size; nmatch = 0; fileended = 0; @@ -46,7 +47,7 @@ register int **argp; goto def; ptr = 0; if (ch != '*') - ptr = argp++; + ptr = va_arg(argp, int *); else ch = *fmt++; len = 0; @@ -100,7 +101,7 @@ register int **argp; static _innum(ptr, type, len, size, iop, eofptr) -int **ptr, *eofptr; +int *ptr, *eofptr; FILE *iop; { extern double atof(); @@ -111,7 +112,7 @@ FILE *iop; long lcval; if (type=='c' || type=='s' || type=='[') - return(_instr(ptr? *(char **)ptr: (char *)NULL, type, len, iop, eofptr)); + return(_instr(ptr? (char *)ptr: (char *)NULL, type, len, iop, eofptr)); lcval = 0; ndigit = 0; scale = INT; @@ -185,23 +186,23 @@ FILE *iop; case (FLOAT<<4) | SHORT: case (FLOAT<<4) | REGULAR: - **(float **)ptr = atof(numbuf); + *(float *)ptr = atof(numbuf); break; case (FLOAT<<4) | LONG: - **(double **)ptr = atof(numbuf); + *(double *)ptr = atof(numbuf); break; case (INT<<4) | SHORT: - **(short **)ptr = lcval; + *(short *)ptr = lcval; break; case (INT<<4) | REGULAR: - **(int **)ptr = lcval; + *(int *)ptr = lcval; break; case (INT<<4) | LONG: - **(long **)ptr = lcval; + *(long *)ptr = lcval; break; } return(1); diff --git a/lib/libc/stdio/findiop.c b/lib/libc/stdio/findiop.c index 5c9e93d..07275b8 100644 --- a/lib/libc/stdio/findiop.c +++ b/lib/libc/stdio/findiop.c @@ -23,7 +23,7 @@ FILE _iob[NSTATIC] = { { 0, NULL, NULL, 0, _IOWRT|_IONBF, 2 }, /* stderr */ }; -extern char *calloc(); +extern void *calloc(); static char sbuf[NSTATIC]; char *_smallbuf = sbuf; @@ -87,10 +87,11 @@ _f_morefiles() for (fp = _iob, iov = iobglue; fp < &_iob[NSTATIC]; /* void */) *iov++ = fp++; - _smallbuf = calloc(nfiles, sizeof(*_smallbuf)); + _smallbuf = (char *)calloc(nfiles, sizeof(*_smallbuf)); return (1); } +void f_prealloc() { register FILE **iov; @@ -104,6 +105,7 @@ f_prealloc() *iov = (FILE *)calloc(1, sizeof **iov); } +void _fwalk(function) register int (*function)(); { @@ -121,6 +123,7 @@ _fwalk(function) } } +void _cleanup() { extern int fclose(); diff --git a/lib/libc/stdio/fprintf.c b/lib/libc/stdio/fprintf.c index f5dfac0..ca358bb 100644 --- a/lib/libc/stdio/fprintf.c +++ b/lib/libc/stdio/fprintf.c @@ -1,32 +1,49 @@ /* * Copyright (c) 1980 Regents of the University of California. - * All rights reserved. The Berkeley software License Agreement - * specifies the terms and conditions for redistribution. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ #if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)fprintf.c 5.2 (Berkeley) 3/9/86"; +static char sccsid[] = "@(#)fprintf.c 5.4 (Berkeley) 6/27/88"; #endif LIBC_SCCS and not lint -#include +#include +#include -fprintf(iop, fmt, args) -register FILE *iop; -char *fmt; +fprintf(iop, fmt, va_alist) + register FILE *iop; + char *fmt; + va_dcl { + va_list argp; + int len; char localbuf[BUFSIZ]; + va_start(argp); if (iop->_flag & _IONBF) { iop->_flag &= ~_IONBF; iop->_ptr = iop->_base = localbuf; iop->_bufsiz = BUFSIZ; - _doprnt(fmt, &args, iop); + len = _doprnt(fmt, argp, iop); fflush(iop); iop->_flag |= _IONBF; iop->_base = NULL; iop->_bufsiz = NULL; iop->_cnt = 0; } else - _doprnt(fmt, &args, iop); - return(ferror(iop)? EOF: 0); + len = _doprnt(fmt, argp, iop); + va_end(argp); + return(ferror(iop) ? EOF : len); } diff --git a/lib/libc/stdio/fread.c b/lib/libc/stdio/fread.c index b78d7d0..89c7cf8 100644 --- a/lib/libc/stdio/fread.c +++ b/lib/libc/stdio/fread.c @@ -10,11 +10,12 @@ static char sccsid[] = "@(#)fread.c 5.2 (Berkeley) 3/9/86"; #include -fread(ptr, size, count, iop) - register char *ptr; +fread(_ptr, size, count, iop) + void *_ptr; unsigned size, count; register FILE *iop; { +#define ptr (*(char **)&_ptr) register int s; int c; @@ -43,4 +44,5 @@ fread(ptr, size, count, iop) } } return (size != 0 ? count - ((s + size - 1) / size) : 0); +#undef ptr } diff --git a/lib/libc/stdio/fwrite.c b/lib/libc/stdio/fwrite.c index aebd4f8..f50301b 100644 --- a/lib/libc/stdio/fwrite.c +++ b/lib/libc/stdio/fwrite.c @@ -10,11 +10,12 @@ static char sccsid[] = "@(#)fwrite.c 5.2 (Berkeley) 3/9/86"; #include -fwrite(ptr, size, count, iop) - register char *ptr; +fwrite(_ptr, size, count, iop) + void *_ptr; unsigned size, count; register FILE *iop; { +#define ptr (*(char **)&_ptr) register int s; s = size * count; @@ -46,4 +47,5 @@ fwrite(ptr, size, count, iop) } } return (size != 0 ? count - ((s + size - 1) / size) : 0); +#undef ptr } diff --git a/lib/libc/gen/popen.c b/lib/libc/stdio/popen.c similarity index 96% rename from lib/libc/gen/popen.c rename to lib/libc/stdio/popen.c index 69f3cb4..ecb31df 100644 --- a/lib/libc/gen/popen.c +++ b/lib/libc/stdio/popen.c @@ -6,7 +6,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)popen.c 5.4 (Berkeley) 3/26/86"; -#endif LIBC_SCCS and not lint +#endif #include #include @@ -23,8 +23,7 @@ static int nfiles; FILE * popen(cmd,mode) char *cmd; - char *mode; -{ + char *mode; { int p[2]; int myside, hisside, pid; @@ -62,8 +61,7 @@ popen(cmd,mode) } pclose(ptr) - FILE *ptr; -{ + FILE *ptr; { int child, pid, status, omask; child = popen_pid[fileno(ptr)]; diff --git a/lib/libc/stdio/printf.c b/lib/libc/stdio/printf.c index 2798278..7686d39 100644 --- a/lib/libc/stdio/printf.c +++ b/lib/libc/stdio/printf.c @@ -1,12 +1,36 @@ +/* + * Copyright (c) 1987 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + #if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)printf.c 5.2 (Berkeley) 3/9/86"; +static char sccsid[] = "@(#)printf.c 5.4 (Berkeley) 6/27/88"; #endif LIBC_SCCS and not lint -#include +#include +#include -printf(fmt, args) -char *fmt; +printf(fmt, va_alist) + char *fmt; + va_dcl { - _doprnt(fmt, &args, stdout); - return(ferror(stdout)? EOF: 0); + va_list argp; + int len; + + va_start(argp); + len = _doprnt(fmt, argp, stdout); + va_end(argp); + return(ferror(stdout) ? EOF : len); } diff --git a/lib/libc/stdio/scanf.c b/lib/libc/stdio/scanf.c index 9f1cab6..7afbabd 100644 --- a/lib/libc/stdio/scanf.c +++ b/lib/libc/stdio/scanf.c @@ -2,32 +2,53 @@ static char sccsid[] = "@(#)scanf.c 5.2 (Berkeley) 3/9/86"; #endif LIBC_SCCS and not lint -#include +#include +#include -scanf(fmt, args) +scanf(fmt, va_alist) char *fmt; +va_dcl { - return(_doscan(stdin, fmt, &args)); + va_list argp; + int len; + + va_start(argp); + len = _doscan(stdin, fmt, argp); + va_end(argp); + return len; } -fscanf(iop, fmt, args) +fscanf(iop, fmt, va_alist) FILE *iop; char *fmt; +va_dcl { - return(_doscan(iop, fmt, &args)); + va_list argp; + int len; + + va_start(argp); + len = _doscan(iop, fmt, argp); + va_end(argp); + return len; } -sscanf(str, fmt, args) +sscanf(str, fmt, va_alist) register char *str; char *fmt; +va_dcl { FILE _strbuf; + va_list argp; + int len; + va_start(argp); _strbuf._flag = _IOREAD|_IOSTRG; _strbuf._ptr = _strbuf._base = str; _strbuf._cnt = 0; while (*str++) _strbuf._cnt++; _strbuf._bufsiz = _strbuf._cnt; - return(_doscan(&_strbuf, fmt, &args)); + len = _doscan(&_strbuf, fmt, argp); + va_end(argp); + return len; } diff --git a/lib/libc/stdio/setbuffer.c b/lib/libc/stdio/setbuffer.c index 7b3c1fc..b1c0379 100644 --- a/lib/libc/stdio/setbuffer.c +++ b/lib/libc/stdio/setbuffer.c @@ -35,11 +35,11 @@ setlinebuf(iop) register FILE *iop; { char *buf; - extern char *malloc(); + extern void *malloc(); fflush(iop); setbuffer(iop, NULL, 0); - buf = malloc(BUFSIZ); + buf = (char *)malloc(BUFSIZ); if (buf != NULL) { setbuffer(iop, buf, BUFSIZ); iop->_flag |= _IOLBF|_IOMYBUF; diff --git a/lib/libc/stdio/sprintf.c b/lib/libc/stdio/sprintf.c index 6bbacce..3728531 100644 --- a/lib/libc/stdio/sprintf.c +++ b/lib/libc/stdio/sprintf.c @@ -1,18 +1,41 @@ +/* + * Copyright (c) 1987 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + #if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)sprintf.c 5.2 (Berkeley) 3/9/86"; +static char sccsid[] = "@(#)sprintf.c 5.5 (Berkeley) 6/27/88"; #endif LIBC_SCCS and not lint -#include +#include +#include -char *sprintf(str, fmt, args) -char *str, *fmt; +sprintf(str, fmt, va_alist) + char *str, *fmt; + va_dcl { + va_list argp; FILE _strbuf; + int len; + va_start(argp); _strbuf._flag = _IOWRT+_IOSTRG; _strbuf._ptr = str; _strbuf._cnt = 32767; - _doprnt(fmt, &args, &_strbuf); - putc('\0', &_strbuf); - return(str); + len = _doprnt(fmt, argp, &_strbuf); + *_strbuf._ptr = 0; + va_end(argp); + return(len); } diff --git a/lib/libc/stdio/vfprintf.c b/lib/libc/stdio/vfprintf.c new file mode 100644 index 0000000..08934ad --- /dev/null +++ b/lib/libc/stdio/vfprintf.c @@ -0,0 +1,46 @@ +/* + * Copyright (c) 1988 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)vfprintf.c 5.2 (Berkeley) 6/27/88"; +#endif + +#include +#include + +int +vfprintf(iop, fmt, argp) + FILE *iop; + char *fmt; + va_list argp; { + int len; + char localbuf[BUFSIZ]; + + if (iop->_flag & _IONBF) { + iop->_flag &= ~_IONBF; + iop->_ptr = iop->_base = localbuf; + len = _doprnt(fmt, argp, iop); + (void) fflush(iop); + iop->_flag |= _IONBF; + iop->_base = NULL; + iop->_bufsiz = 0; + iop->_cnt = 0; + } else + len = _doprnt(fmt, argp, iop); + + return (ferror(iop) ? EOF : len); +} diff --git a/lib/libc/stdio/vprintf.c b/lib/libc/stdio/vprintf.c new file mode 100644 index 0000000..0db5729 --- /dev/null +++ b/lib/libc/stdio/vprintf.c @@ -0,0 +1,33 @@ +/* + * Copyright (c) 1988 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)vprintf.c 5.2 (Berkeley) 6/27/88"; +#endif + +#include +#include + +int +vprintf(fmt, argp) + char *fmt; + va_list argp; { + int len; + + len = _doprnt(fmt, argp, stdout); + return (ferror(stdout) ? EOF : len); +} diff --git a/lib/libc/stdio/vsprintf.c b/lib/libc/stdio/vsprintf.c new file mode 100644 index 0000000..f2a588d --- /dev/null +++ b/lib/libc/stdio/vsprintf.c @@ -0,0 +1,38 @@ +/* + * Copyright (c) 1988 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)vsprintf.c 5.2 (Berkeley) 6/27/88"; +#endif + +#include +#include + +int +vsprintf(str, fmt, argp) + char *str, *fmt; + va_list argp; { + FILE f; + int len; + + f._flag = _IOWRT+_IOSTRG; + f._ptr = str; + f._cnt = 32767; + len = _doprnt(fmt, argp, &f); + *f._ptr = 0; + return (len); +} diff --git a/lib/libc/sys/Makefile b/lib/libc/sys/Makefile new file mode 100644 index 0000000..c61a4ae --- /dev/null +++ b/lib/libc/sys/Makefile @@ -0,0 +1,88 @@ +# +# Copyright (c) 1980 Regents of the University of California. +# All rights reserved. The Berkeley software License Agreement +# specifies the terms and conditions for redistribution. +# +# @(#)Makefile 6.1 (Berkeley) 1/29/86 +# + +SRCS= accept.c access.c acct.c adjtime.c bind.c brk.c chdir.c chmod.c \ + chown.c chroot.c close.c connect.c creat.c dup2.c dup.c execl.c \ + execle.c exect.c execv.c execve.c _exit.c fchmod.c fchown.c fcntl.c \ + flock.c fork.c fstat.c fsync.c ftruncate.c getdtablesize.c getegid.c \ + geteuid.c getgid.c getgroups.c gethostid.c gethostname.c getitimer.c \ + getpagesize.c getpeername.c getpgrp.c getpid.c getppid.c \ + getpriority.c getrlimit.c getrusage.c getsockname.c getsockopt.c \ + gettimeofday.c getuid.c ioctl.c isatty.c kill.c killpg.c link.c \ + listen.c lseek.c lstat.c mkdir.c mknod.c mount.c open.c pipe.c \ + profil.c ptrace.c quota.c read.c readlink.c readv.c reboot.c recv.c \ + recvfrom.c recvmsg.c rename.c rmdir.c sbrk.c select.c send.c \ + sendmsg.c sendto.c setgroups.c sethostid.c sethostname.c setitimer.c \ + setpgrp.c setpriority.c setquota.c setregid.c setreuid.c setrlimit.c \ + setsockopt.c settimeofday.c shutdown.c sigblock.c sigpause.c \ + sigreturn.c sigsetmask.c sigstack.c sigvec.c socket.c socketpair.c \ + stat.c swapon.c symlink.c sync.c truncate.c umask.c umount.c unlink.c \ + utimes.c vfork.c vhangup.c vopen.c wait3.c wait.c write.c writev.c +OBJS= accept.o access.o acct.o adjtime.o bind.o brk.o chdir.o chmod.o \ + chown.o chroot.o close.o connect.o creat.o dup2.o dup.o execl.o \ + execle.o exect.o execv.o execve.o _exit.o fchmod.o fchown.o fcntl.o \ + flock.o fork.o fstat.o fsync.o ftruncate.o getdtablesize.o getegid.o \ + geteuid.o getgid.o getgroups.o gethostid.o gethostname.o getitimer.o \ + getpagesize.o getpeername.o getpgrp.o getpid.o getppid.o \ + getpriority.o getrlimit.o getrusage.o getsockname.o getsockopt.o \ + gettimeofday.o getuid.o ioctl.o isatty.o kill.o killpg.o link.o \ + listen.o lseek.o lstat.o mkdir.o mknod.o mount.o open.o pipe.o \ + profil.o ptrace.o quota.o read.o readlink.o readv.o reboot.o recv.o \ + recvfrom.o recvmsg.o rename.o rmdir.o sbrk.o select.o send.o \ + sendmsg.o sendto.o setgroups.o sethostid.o sethostname.o setitimer.o \ + setpgrp.o setpriority.o setquota.o setregid.o setreuid.o setrlimit.o \ + setsockopt.o settimeofday.o shutdown.o sigblock.o sigpause.o \ + sigreturn.o sigsetmask.o sigstack.o sigvec.o socket.o socketpair.o \ + stat.o swapon.o symlink.o sync.o truncate.o umask.o umount.o unlink.o \ + utimes.o vfork.o vhangup.o vopen.o wait3.o wait.o write.o writev.o +CFLAGS= -O ${DEFS} +TAGSFILE=tags + +.c.o: + ${CC} -p -c ${CFLAGS} $*.c + -ld -X -r $*.o + mv a.out profiled/$*.o + ${CC} ${CFLAGS} -c $*.c + -ld -x -r $*.o + mv a.out $*.o + +syslib syslib_p: ${OBJS} + @echo "building profiled syslib" + @cd profiled; ar cru ../syslib_p ${OBJS} + @echo "building normal syslib" + @ar cru syslib ${OBJS} + +tags: + cwd=`pwd`; \ + for i in ${SRCS}; do \ + ctags -a -f ${TAGSFILE} $$cwd/$$i; \ + done + +clean: + rm -f syslib syslib_p *.o profiled/*.o errs a.out core \ + tags Makefile.bak + +depend: + for i in ${SRCS}; do \ + cc -M ${CFLAGS} $$i | awk ' { if ($$1 != prev) \ + { if (rec != "") print rec; rec = $$0; prev = $$1; } \ + else { if (length(rec $$2) > 78) { print rec; rec = $$0; } \ + else rec = rec " " $$2 } } \ + END { print rec } ' >> makedep; done + echo '/^# DO NOT DELETE THIS LINE/+2,$$d' >eddep + echo '$$r makedep' >>eddep + echo 'w' >>eddep + cp Makefile Makefile.bak + ed - Makefile < eddep + rm eddep makedep + echo '# DEPENDENCIES MUST END AT END OF FILE' >> Makefile + echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >> Makefile + echo '# see make depend above' >> Makefile + +# DO NOT DELETE THIS LINE -- make depend uses it + diff --git a/lib/libc/sys/_exit.c b/lib/libc/sys/_exit.c new file mode 100644 index 0000000..7f7bcc4 --- /dev/null +++ b/lib/libc/sys/_exit.c @@ -0,0 +1,4 @@ +void _exit(s) { + write(2, "_exit()\n", 8); + abort(); +} diff --git a/lib/libc/sys/accept.c b/lib/libc/sys/accept.c new file mode 100644 index 0000000..2725b7b --- /dev/null +++ b/lib/libc/sys/accept.c @@ -0,0 +1,6 @@ +#include + +int accept(s, a, l) struct sockaddr *a; int *l; { + write(2, "accept()\n", 9); + abort(); +} diff --git a/lib/libc/sys/access.c b/lib/libc/sys/access.c new file mode 100644 index 0000000..aecd4ad --- /dev/null +++ b/lib/libc/sys/access.c @@ -0,0 +1,4 @@ +int access(p, m) char *p; { + write(2, "access()\n", 9); + abort(); +} diff --git a/lib/libc/sys/acct.c b/lib/libc/sys/acct.c new file mode 100644 index 0000000..bc07d5b --- /dev/null +++ b/lib/libc/sys/acct.c @@ -0,0 +1,4 @@ +int acct(f) char *f; { + write(2, "acct()\n", 7); + abort(); +} diff --git a/lib/libc/sys/adjtime.c b/lib/libc/sys/adjtime.c new file mode 100644 index 0000000..98b7570 --- /dev/null +++ b/lib/libc/sys/adjtime.c @@ -0,0 +1,6 @@ +#include + +int adjtime(delta, odelta) struct timeval *delta, *odelta; { + write(2, "adjtime()\n", 10); + abort(); +} diff --git a/lib/libc/sys/bind.c b/lib/libc/sys/bind.c new file mode 100644 index 0000000..f263554 --- /dev/null +++ b/lib/libc/sys/bind.c @@ -0,0 +1,6 @@ +#include + +int bind(s, n, l) struct sockaddr *n; { + write(2, "bind()\n", 7); + abort(); +} diff --git a/lib/libc/sys/brk.c b/lib/libc/sys/brk.c new file mode 100644 index 0000000..80f33fa --- /dev/null +++ b/lib/libc/sys/brk.c @@ -0,0 +1,4 @@ +void *brk(a) void *a; { + write(2, "brk()\n", 6); + abort(); +} diff --git a/lib/libc/sys/chdir.c b/lib/libc/sys/chdir.c new file mode 100644 index 0000000..e00809c --- /dev/null +++ b/lib/libc/sys/chdir.c @@ -0,0 +1,4 @@ +int chdir(s) char *s; { + write(2, "chdir()\n", 8); + abort(); +} diff --git a/lib/libc/sys/chmod.c b/lib/libc/sys/chmod.c new file mode 100644 index 0000000..1e5bf5c --- /dev/null +++ b/lib/libc/sys/chmod.c @@ -0,0 +1,4 @@ +int chmod(s, m) char *s; { + write(2, "chmod()\n", 8); + abort(); +} diff --git a/lib/libc/sys/chown.c b/lib/libc/sys/chown.c new file mode 100644 index 0000000..d9e77fa --- /dev/null +++ b/lib/libc/sys/chown.c @@ -0,0 +1,4 @@ +int chown(s, u, g) char *s; { + write(2, "chown()\n", 8); + abort(); +} diff --git a/lib/libc/sys/chroot.c b/lib/libc/sys/chroot.c new file mode 100644 index 0000000..d5c0a19 --- /dev/null +++ b/lib/libc/sys/chroot.c @@ -0,0 +1,4 @@ +int chroot(d) char *d; { + write(2, "chroot()\n", 9); + abort(); +} diff --git a/lib/libc/sys/close.c b/lib/libc/sys/close.c new file mode 100644 index 0000000..1397e5e --- /dev/null +++ b/lib/libc/sys/close.c @@ -0,0 +1,4 @@ +int close(f) { + write(2, "close()\n", 8); + abort(); +} diff --git a/lib/libc/sys/connect.c b/lib/libc/sys/connect.c new file mode 100644 index 0000000..472e908 --- /dev/null +++ b/lib/libc/sys/connect.c @@ -0,0 +1,6 @@ +#include + +int connect(s, n, l) struct sockaddr *n; { + write(2, "connect()\n", 10); + abort(); +} diff --git a/lib/libc/sys/creat.c b/lib/libc/sys/creat.c new file mode 100644 index 0000000..63b90f4 --- /dev/null +++ b/lib/libc/sys/creat.c @@ -0,0 +1,4 @@ +int creat(s, m) char *s; { + write(2, "creat()\n", 8); + abort(); +} diff --git a/lib/libc/sys/dup.c b/lib/libc/sys/dup.c new file mode 100644 index 0000000..7ec4eb5 --- /dev/null +++ b/lib/libc/sys/dup.c @@ -0,0 +1,4 @@ +int dup(f) { + write(2, "dup()\n", 6); + abort(); +} diff --git a/lib/libc/sys/dup2.c b/lib/libc/sys/dup2.c new file mode 100644 index 0000000..f905bfd --- /dev/null +++ b/lib/libc/sys/dup2.c @@ -0,0 +1,4 @@ +int dup2(o, n) { + write(2, "dup2()\n", 7); + abort(); +} diff --git a/lib/libc/sys/execl.c b/lib/libc/sys/execl.c new file mode 100644 index 0000000..c9742c5 --- /dev/null +++ b/lib/libc/sys/execl.c @@ -0,0 +1,5 @@ +#include +void execl(f, va_alist) char *f; va_dcl { + write(2, "execl()\n", 8); + abort(); +} diff --git a/lib/libc/sys/execle.c b/lib/libc/sys/execle.c new file mode 100644 index 0000000..f3105c3 --- /dev/null +++ b/lib/libc/sys/execle.c @@ -0,0 +1,5 @@ +#include +void execle(f, va_alist) char *f; va_dcl { + write(2, "execle()\n", 9); + abort(); +} diff --git a/lib/libc/sys/exect.c b/lib/libc/sys/exect.c new file mode 100644 index 0000000..86f3537 --- /dev/null +++ b/lib/libc/sys/exect.c @@ -0,0 +1,4 @@ +void exect(s, v, e) char *s, *v[], *e[]; { + write(2, "exect()\n", 8); + abort(); +} diff --git a/lib/libc/sys/execv.c b/lib/libc/sys/execv.c new file mode 100644 index 0000000..9728baf --- /dev/null +++ b/lib/libc/sys/execv.c @@ -0,0 +1,4 @@ +void execv(s, v) char *s, *v[]; { + write(2, "execv()\n", 8); + abort(); +} diff --git a/lib/libc/sys/execve.c b/lib/libc/sys/execve.c new file mode 100644 index 0000000..963f235 --- /dev/null +++ b/lib/libc/sys/execve.c @@ -0,0 +1,4 @@ +void execve(s, v, e) char *s, *v[], *e[]; { + write(2, "execve()\n", 9); + abort(); +} diff --git a/lib/libc/sys/fchmod.c b/lib/libc/sys/fchmod.c new file mode 100644 index 0000000..8e4eb33 --- /dev/null +++ b/lib/libc/sys/fchmod.c @@ -0,0 +1,4 @@ +int fchmod(f, m) { + write(2, "fchmod()\n", 9); + abort(); +} diff --git a/lib/libc/sys/fchown.c b/lib/libc/sys/fchown.c new file mode 100644 index 0000000..b41f83b --- /dev/null +++ b/lib/libc/sys/fchown.c @@ -0,0 +1,4 @@ +int fchown(f, u, g) { + write(2, "fchown()\n", 9); + abort(); +} diff --git a/lib/libc/sys/fcntl.c b/lib/libc/sys/fcntl.c new file mode 100644 index 0000000..5cddbf3 --- /dev/null +++ b/lib/libc/sys/fcntl.c @@ -0,0 +1,4 @@ +int fcntl(f, c, a) { + write(2, "fcntl()\n", 8); + abort(); +} diff --git a/lib/libc/sys/flock.c b/lib/libc/sys/flock.c new file mode 100644 index 0000000..8944c49 --- /dev/null +++ b/lib/libc/sys/flock.c @@ -0,0 +1,4 @@ +int flock(f, o) { + write(2, "flock()\n", 8); + abort(); +} diff --git a/lib/libc/sys/fork.c b/lib/libc/sys/fork.c new file mode 100644 index 0000000..cc78532 --- /dev/null +++ b/lib/libc/sys/fork.c @@ -0,0 +1,4 @@ +int fork() { + write(2, "fork()\n", 7); + abort(); +} diff --git a/lib/libc/sys/fstat.c b/lib/libc/sys/fstat.c new file mode 100644 index 0000000..9c7c4da --- /dev/null +++ b/lib/libc/sys/fstat.c @@ -0,0 +1,6 @@ +#include + +int fstat(f, b) struct stat *b; { + write(2, "fstat()\n", 8); + abort(); +} diff --git a/lib/libc/sys/fsync.c b/lib/libc/sys/fsync.c new file mode 100644 index 0000000..bf2cbce --- /dev/null +++ b/lib/libc/sys/fsync.c @@ -0,0 +1,4 @@ +int fsync(f) { + write(2, "fsync()\n", 8); + abort(); +} diff --git a/lib/libc/sys/ftruncate.c b/lib/libc/sys/ftruncate.c new file mode 100644 index 0000000..eba2b44 --- /dev/null +++ b/lib/libc/sys/ftruncate.c @@ -0,0 +1,6 @@ +#include + +int ftruncate(d, l) off_t l; { + write(2, "ftruncate()\n", 12); + abort(); +} diff --git a/lib/libc/sys/getdtablesize.c b/lib/libc/sys/getdtablesize.c new file mode 100644 index 0000000..c1105d3 --- /dev/null +++ b/lib/libc/sys/getdtablesize.c @@ -0,0 +1,4 @@ +int getdtablesize() { + write(2, "getdtablesize()\n", 16); + abort(); +} diff --git a/lib/libc/sys/getegid.c b/lib/libc/sys/getegid.c new file mode 100644 index 0000000..4603a9c --- /dev/null +++ b/lib/libc/sys/getegid.c @@ -0,0 +1,6 @@ +#include + +gid_t getegid() { + write(2, "getegid()\n", 10); + abort(); +} diff --git a/lib/libc/sys/geteuid.c b/lib/libc/sys/geteuid.c new file mode 100644 index 0000000..32e1a47 --- /dev/null +++ b/lib/libc/sys/geteuid.c @@ -0,0 +1,6 @@ +#include + +uid_t geteuid() { + write(2, "geteuid()\n", 10); + abort(); +} diff --git a/lib/libc/sys/getgid.c b/lib/libc/sys/getgid.c new file mode 100644 index 0000000..c0b2537 --- /dev/null +++ b/lib/libc/sys/getgid.c @@ -0,0 +1,6 @@ +#include + +gid_t getgid() { + write(2, "getgid()\n", 9); + abort(); +} diff --git a/lib/libc/sys/getgroups.c b/lib/libc/sys/getgroups.c new file mode 100644 index 0000000..aa44917 --- /dev/null +++ b/lib/libc/sys/getgroups.c @@ -0,0 +1,4 @@ +int getgroups(n, g) int n, *g; { + write(2, "getgroups()\n", 12); + abort(); +} diff --git a/lib/libc/sys/gethostid.c b/lib/libc/sys/gethostid.c new file mode 100644 index 0000000..0c3ca43 --- /dev/null +++ b/lib/libc/sys/gethostid.c @@ -0,0 +1,4 @@ +long gethostid() { + write(2, "gethostid()\n", 12); + abort(); +} diff --git a/lib/libc/sys/gethostname.c b/lib/libc/sys/gethostname.c new file mode 100644 index 0000000..787d7d9 --- /dev/null +++ b/lib/libc/sys/gethostname.c @@ -0,0 +1,4 @@ +int gethostname(n, l) char *n; int l; { + write(2, "gethostname()\n", 14); + abort(); +} diff --git a/lib/libc/sys/getitimer.c b/lib/libc/sys/getitimer.c new file mode 100644 index 0000000..7d0c1ac --- /dev/null +++ b/lib/libc/sys/getitimer.c @@ -0,0 +1,6 @@ +#include + +int getitimer(w, v) struct itimerval *v; { + write(2, "getitimer()\n", 12); + abort(); +} diff --git a/lib/libc/sys/getpagesize.c b/lib/libc/sys/getpagesize.c new file mode 100644 index 0000000..8506315 --- /dev/null +++ b/lib/libc/sys/getpagesize.c @@ -0,0 +1,4 @@ +int getpagesize() { + write(2, "getpagesize()\n", 14); + abort(); +} diff --git a/lib/libc/sys/getpeername.c b/lib/libc/sys/getpeername.c new file mode 100644 index 0000000..012153d --- /dev/null +++ b/lib/libc/sys/getpeername.c @@ -0,0 +1,6 @@ +#include + +int getpeername(s, n, l) struct sockaddr *n; int *l; { + write(2, "getpeername()\n", 14); + abort(); +} diff --git a/lib/libc/sys/getpgrp.c b/lib/libc/sys/getpgrp.c new file mode 100644 index 0000000..4719980 --- /dev/null +++ b/lib/libc/sys/getpgrp.c @@ -0,0 +1,4 @@ +int getpgrp(p) { + write(2, "getpgrp()\n", 10); + abort(); +} diff --git a/lib/libc/sys/getpid.c b/lib/libc/sys/getpid.c new file mode 100644 index 0000000..f1e1a5e --- /dev/null +++ b/lib/libc/sys/getpid.c @@ -0,0 +1,4 @@ +int getpid() { + write(2, "getpid()\n", 9); + abort(); +} diff --git a/lib/libc/sys/getppid.c b/lib/libc/sys/getppid.c new file mode 100644 index 0000000..82c80c9 --- /dev/null +++ b/lib/libc/sys/getppid.c @@ -0,0 +1,4 @@ +int getppid() { + write(2, "getppid()\n", 10); + abort(); +} diff --git a/lib/libc/sys/getpriority.c b/lib/libc/sys/getpriority.c new file mode 100644 index 0000000..f788762 --- /dev/null +++ b/lib/libc/sys/getpriority.c @@ -0,0 +1,4 @@ +int getpriority(w, who) { + write(2, "getpriority()\n", 14); + abort(); +} diff --git a/lib/libc/sys/getrlimit.c b/lib/libc/sys/getrlimit.c new file mode 100644 index 0000000..20ee251 --- /dev/null +++ b/lib/libc/sys/getrlimit.c @@ -0,0 +1,6 @@ +#include + +int getrlimit(res, rip) struct rlimit *rip; { + write(2, "getrlimit()\n", 12); + abort(); +} diff --git a/lib/libc/sys/getrusage.c b/lib/libc/sys/getrusage.c new file mode 100644 index 0000000..9751a03 --- /dev/null +++ b/lib/libc/sys/getrusage.c @@ -0,0 +1,6 @@ +#include + +int getrusage(res, rip) struct rusage *rip; { + write(2, "getrusage()\n", 12); + abort(); +} diff --git a/lib/libc/sys/getsockname.c b/lib/libc/sys/getsockname.c new file mode 100644 index 0000000..b90a597 --- /dev/null +++ b/lib/libc/sys/getsockname.c @@ -0,0 +1,6 @@ +#include + +int getsockname(s, name, namelen) struct sockaddr *name; int *namelen; { + write(2, "getsockname()\n", 14); + abort(); +} diff --git a/lib/libc/sys/getsockopt.c b/lib/libc/sys/getsockopt.c new file mode 100644 index 0000000..a8b038f --- /dev/null +++ b/lib/libc/sys/getsockopt.c @@ -0,0 +1,4 @@ +int getsockopt(s, level, opt, buf, len) void *buf; int *len; { + write(2, "getsockopt()\n", 13); + abort(); +} diff --git a/lib/libc/sys/gettimeofday.c b/lib/libc/sys/gettimeofday.c new file mode 100644 index 0000000..de79c23 --- /dev/null +++ b/lib/libc/sys/gettimeofday.c @@ -0,0 +1,6 @@ +#include + +int gettimeofday(t, z) struct timeval *t; struct timezone *z; { + write(2, "gettimeofday()\n", 15); + abort(); +} diff --git a/lib/libc/sys/getuid.c b/lib/libc/sys/getuid.c new file mode 100644 index 0000000..13189af --- /dev/null +++ b/lib/libc/sys/getuid.c @@ -0,0 +1,6 @@ +#include + +uid_t getuid() { + write(2, "getuid()\n", 9); + abort(); +} diff --git a/lib/libc/sys/ioctl.c b/lib/libc/sys/ioctl.c new file mode 100644 index 0000000..55f0d14 --- /dev/null +++ b/lib/libc/sys/ioctl.c @@ -0,0 +1,6 @@ +#include + +int ioctl(d, r, p) u_long r; void *p; { + write(2, "ioctl()\n", 8); + abort(); +} diff --git a/lib/libc/gen/isatty.c b/lib/libc/sys/isatty.c similarity index 85% rename from lib/libc/gen/isatty.c rename to lib/libc/sys/isatty.c index 42eb42e..888a899 100644 --- a/lib/libc/gen/isatty.c +++ b/lib/libc/sys/isatty.c @@ -1,6 +1,6 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)isatty.c 5.2 (Berkeley) 3/9/86"; -#endif LIBC_SCCS and not lint +#endif /* * Returns 1 iff file is a tty @@ -8,8 +8,7 @@ static char sccsid[] = "@(#)isatty.c 5.2 (Berkeley) 3/9/86"; #include -isatty(f) -{ +isatty(f) { struct sgttyb ttyb; if (ioctl(f, TIOCGETP, &ttyb) < 0) diff --git a/lib/libc/sys/kill.c b/lib/libc/sys/kill.c new file mode 100644 index 0000000..bd5fbbc --- /dev/null +++ b/lib/libc/sys/kill.c @@ -0,0 +1,4 @@ +int kill(p, s) { + write(2, "kill()\n", 7); + abort(); +} diff --git a/lib/libc/sys/killpg.c b/lib/libc/sys/killpg.c new file mode 100644 index 0000000..7b5ffc4 --- /dev/null +++ b/lib/libc/sys/killpg.c @@ -0,0 +1,4 @@ +int killpg(pg, s) { + write(2, "killpg()\n", 9); + abort(); +} diff --git a/lib/libc/sys/link.c b/lib/libc/sys/link.c new file mode 100644 index 0000000..cbf25e8 --- /dev/null +++ b/lib/libc/sys/link.c @@ -0,0 +1,4 @@ +int link(a, b) char *a, *b; { + write(2, "link()\n", 7); + abort(); +} diff --git a/lib/libc/sys/listen.c b/lib/libc/sys/listen.c new file mode 100644 index 0000000..b762851 --- /dev/null +++ b/lib/libc/sys/listen.c @@ -0,0 +1,4 @@ +int listen(s, b){ + write(2, "listen()\n", 9); + abort(); +} diff --git a/lib/libc/sys/lseek.c b/lib/libc/sys/lseek.c new file mode 100644 index 0000000..68839d6 --- /dev/null +++ b/lib/libc/sys/lseek.c @@ -0,0 +1,6 @@ +#include + +off_t lseek(f, o, d) off_t o; { + write(2, "lseek()\n", 8); + abort(); +} diff --git a/lib/libc/sys/lstat.c b/lib/libc/sys/lstat.c new file mode 100644 index 0000000..3d5411c --- /dev/null +++ b/lib/libc/sys/lstat.c @@ -0,0 +1,6 @@ +#include + +int lstat(s, b) char *s; struct stat *b; { + write(2, "lstat()\n", 8); + abort(); +} diff --git a/lib/libc/sys/mkdir.c b/lib/libc/sys/mkdir.c new file mode 100644 index 0000000..4c62724 --- /dev/null +++ b/lib/libc/sys/mkdir.c @@ -0,0 +1,4 @@ +int mkdir(p, m) char *p; { + write(2, "mkdir()\n", 8); + abort(); +} diff --git a/lib/libc/sys/mknod.c b/lib/libc/sys/mknod.c new file mode 100644 index 0000000..23c78f3 --- /dev/null +++ b/lib/libc/sys/mknod.c @@ -0,0 +1,4 @@ +int mknod(n, m, a) char *n; { + write(2, "mknod()\n", 8); + abort(); +} diff --git a/lib/libc/sys/mount.c b/lib/libc/sys/mount.c new file mode 100644 index 0000000..c0a9ea0 --- /dev/null +++ b/lib/libc/sys/mount.c @@ -0,0 +1,4 @@ +int mount(s, n, f) char *s, *n; { + write(2, "mount()\n", 8); + abort(); +} diff --git a/lib/libc/sys/open.c b/lib/libc/sys/open.c new file mode 100644 index 0000000..92a5bb9 --- /dev/null +++ b/lib/libc/sys/open.c @@ -0,0 +1,11 @@ +#include + +int open(f, m, va_alist) char *f; va_dcl { + va_list argp; + int res; + + va_start(argp); + res = vopen(f, m, argp); + va_end(argp); + return res; +} diff --git a/lib/libc/sys/pipe.c b/lib/libc/sys/pipe.c new file mode 100644 index 0000000..085ad2a --- /dev/null +++ b/lib/libc/sys/pipe.c @@ -0,0 +1,4 @@ +int pipe(f) int f[2]; { + write(2, "pipe()\n", 7); + abort(); +} diff --git a/lib/libc/sys/profil.c b/lib/libc/sys/profil.c new file mode 100644 index 0000000..de3d355 --- /dev/null +++ b/lib/libc/sys/profil.c @@ -0,0 +1,4 @@ +void profil(b, s, o, i) char *b; { + write(2, "profil()\n", 9); + abort(); +} diff --git a/lib/libc/sys/ptrace.c b/lib/libc/sys/ptrace.c new file mode 100644 index 0000000..4f73683 --- /dev/null +++ b/lib/libc/sys/ptrace.c @@ -0,0 +1,4 @@ +int ptrace(r, p, a, d) int *a; { + write(2, "ptrace()\n", 9); + abort(); +} diff --git a/lib/libc/sys/quota.c b/lib/libc/sys/quota.c new file mode 100644 index 0000000..007e302 --- /dev/null +++ b/lib/libc/sys/quota.c @@ -0,0 +1,4 @@ +int quota(c, u, a, ad) void *ad; { + write(2, "quota()\n", 8); + abort(); +} diff --git a/lib/libc/sys/read.c b/lib/libc/sys/read.c new file mode 100644 index 0000000..078cfd3 --- /dev/null +++ b/lib/libc/sys/read.c @@ -0,0 +1,4 @@ +int read(f, b, l) void *b; { + write(2, "read()\n", 7); + abort(); +} diff --git a/lib/libc/sys/readlink.c b/lib/libc/sys/readlink.c new file mode 100644 index 0000000..41416c8 --- /dev/null +++ b/lib/libc/sys/readlink.c @@ -0,0 +1,4 @@ +int readlink(p, b, s) char *p, *b; { + write(2, "readlink()\n", 11); + abort(); +} diff --git a/lib/libc/sys/readv.c b/lib/libc/sys/readv.c new file mode 100644 index 0000000..fae61bb --- /dev/null +++ b/lib/libc/sys/readv.c @@ -0,0 +1,6 @@ +#include + +int readv(d, v, l) struct iovec *v; { + write(2, "readv()\n", 8); + abort(); +} diff --git a/lib/libc/sys/reboot.c b/lib/libc/sys/reboot.c new file mode 100644 index 0000000..4e757d7 --- /dev/null +++ b/lib/libc/sys/reboot.c @@ -0,0 +1,4 @@ +void reboot(h) { + write(2, "reboot()\n", 9); + abort(); +} diff --git a/lib/libc/sys/recv.c b/lib/libc/sys/recv.c new file mode 100644 index 0000000..3223282 --- /dev/null +++ b/lib/libc/sys/recv.c @@ -0,0 +1,4 @@ +int recv(s, b, l, f) void *b; { + write(2, "recv()\n", 7); + abort(); +} diff --git a/lib/libc/sys/recvfrom.c b/lib/libc/sys/recvfrom.c new file mode 100644 index 0000000..d904feb --- /dev/null +++ b/lib/libc/sys/recvfrom.c @@ -0,0 +1,6 @@ +#include + +int recvfrom(s, b, l, f, fr, fl) void *b; struct sockaddr *fr; int *fl; { + write(2, "recvfrom()\n", 11); + abort(); +} diff --git a/lib/libc/sys/recvmsg.c b/lib/libc/sys/recvmsg.c new file mode 100644 index 0000000..3e1e070 --- /dev/null +++ b/lib/libc/sys/recvmsg.c @@ -0,0 +1,6 @@ +#include + +int recvmsg(s, m, f) struct msghdr m[]; { + write(2, "recvmsg()\n", 10); + abort(); +} diff --git a/lib/libc/sys/rename.c b/lib/libc/sys/rename.c new file mode 100644 index 0000000..83f12cc --- /dev/null +++ b/lib/libc/sys/rename.c @@ -0,0 +1,4 @@ +int rename(f, t) char *f, *t; { + write(2, "rename()\n", 9); + abort(); +} diff --git a/lib/libc/sys/rmdir.c b/lib/libc/sys/rmdir.c new file mode 100644 index 0000000..45719f0 --- /dev/null +++ b/lib/libc/sys/rmdir.c @@ -0,0 +1,4 @@ +int rmdir(p) char *p; { + write(2, "rmdir()\n", 8); + abort(); +} diff --git a/lib/libc/sys/sbrk.c b/lib/libc/sys/sbrk.c new file mode 100644 index 0000000..457849f --- /dev/null +++ b/lib/libc/sys/sbrk.c @@ -0,0 +1,4 @@ +void *sbrk(i) { + write(2, "sbrk()\n", 7); + abort(); +} diff --git a/lib/libc/sys/select.c b/lib/libc/sys/select.c new file mode 100644 index 0000000..7e58ab5 --- /dev/null +++ b/lib/libc/sys/select.c @@ -0,0 +1,7 @@ +#include +#include + +int select(n, r, w, e, t) fd_set *r, *w, *e; struct timeval *t; { + write(2, "select()\n", 9); + abort(); +} diff --git a/lib/libc/sys/send.c b/lib/libc/sys/send.c new file mode 100644 index 0000000..b806ef3 --- /dev/null +++ b/lib/libc/sys/send.c @@ -0,0 +1,4 @@ +int send(s, m, l, f) void *m; { + write(2, "send()\n", 7); + abort(); +} diff --git a/lib/libc/sys/sendmsg.c b/lib/libc/sys/sendmsg.c new file mode 100644 index 0000000..c1b5ff8 --- /dev/null +++ b/lib/libc/sys/sendmsg.c @@ -0,0 +1,6 @@ +#include + +int sendmsg(s, m, l) struct msghdr m[]; { + write(2, "sendmsg()\n", 10); + abort(); +} diff --git a/lib/libc/sys/sendto.c b/lib/libc/sys/sendto.c new file mode 100644 index 0000000..33ebacb --- /dev/null +++ b/lib/libc/sys/sendto.c @@ -0,0 +1,6 @@ +#include + +int sendto(s, m, l, f, t, tl) void *m; struct sockaddr *t; { + write(2, "sendto()\n", 9); + abort(); +} diff --git a/lib/libc/sys/setgroups.c b/lib/libc/sys/setgroups.c new file mode 100644 index 0000000..0d8b166 --- /dev/null +++ b/lib/libc/sys/setgroups.c @@ -0,0 +1,4 @@ +int setgroups(n, g) int *g; { + write(2, "setgroups()\n", 12); + abort(); +} diff --git a/lib/libc/sys/sethostid.c b/lib/libc/sys/sethostid.c new file mode 100644 index 0000000..13aa28d --- /dev/null +++ b/lib/libc/sys/sethostid.c @@ -0,0 +1,4 @@ +int sethostid(h) long h; { + write(2, "sethostid()\n", 12); + abort(); +} diff --git a/lib/libc/sys/sethostname.c b/lib/libc/sys/sethostname.c new file mode 100644 index 0000000..15b9bf5 --- /dev/null +++ b/lib/libc/sys/sethostname.c @@ -0,0 +1,4 @@ +int sethostname(n, l) char *n; int l; { + write(2, "sethostname()\n", 14); + abort(); +} diff --git a/lib/libc/sys/setitimer.c b/lib/libc/sys/setitimer.c new file mode 100644 index 0000000..49ca8eb --- /dev/null +++ b/lib/libc/sys/setitimer.c @@ -0,0 +1,6 @@ +#include + +int setitimer(w, v, ov) struct itimerval *v, *ov; { + write(2, "setitimer()\n", 12); + abort(); +} diff --git a/lib/libc/sys/setpgrp.c b/lib/libc/sys/setpgrp.c new file mode 100644 index 0000000..28806b2 --- /dev/null +++ b/lib/libc/sys/setpgrp.c @@ -0,0 +1,4 @@ +int setpgrp(g, pg) { + write(2, "setpgrp()\n", 10); + abort(); +} diff --git a/lib/libc/sys/setpriority.c b/lib/libc/sys/setpriority.c new file mode 100644 index 0000000..6dfca6e --- /dev/null +++ b/lib/libc/sys/setpriority.c @@ -0,0 +1,4 @@ +int setpriority(w, who, pri) { + write(2, "setpriority()\n", 14); + abort(); +} diff --git a/lib/libc/sys/setquota.c b/lib/libc/sys/setquota.c new file mode 100644 index 0000000..3182ebd --- /dev/null +++ b/lib/libc/sys/setquota.c @@ -0,0 +1,4 @@ +int setquota(s, f) char *s, *f; { + write(2, "setquota()\n", 11); + abort(); +} diff --git a/lib/libc/sys/setregid.c b/lib/libc/sys/setregid.c new file mode 100644 index 0000000..ef98c6c --- /dev/null +++ b/lib/libc/sys/setregid.c @@ -0,0 +1,4 @@ +int setregid(r, e) int r, e; { + write(2, "setregid()\n", 11); + abort(); +} diff --git a/lib/libc/sys/setreuid.c b/lib/libc/sys/setreuid.c new file mode 100644 index 0000000..5a26f5b --- /dev/null +++ b/lib/libc/sys/setreuid.c @@ -0,0 +1,4 @@ +int setreuid(r, e) int r, e; { + write(2, "setreuid()\n", 11); + abort(); +} diff --git a/lib/libc/sys/setrlimit.c b/lib/libc/sys/setrlimit.c new file mode 100644 index 0000000..9d86780 --- /dev/null +++ b/lib/libc/sys/setrlimit.c @@ -0,0 +1,6 @@ +#include + +int setrlimit(res, rip) struct rlimit *rip; { + write(2, "setrlimit()\n", 12); + abort(); +} diff --git a/lib/libc/sys/setsockopt.c b/lib/libc/sys/setsockopt.c new file mode 100644 index 0000000..0c6ddaa --- /dev/null +++ b/lib/libc/sys/setsockopt.c @@ -0,0 +1,4 @@ +int setsockopt(s, level, opt, buf, len) void *buf; { + write(2, "setsockopt()\n", 13); + abort(); +} diff --git a/lib/libc/sys/settimeofday.c b/lib/libc/sys/settimeofday.c new file mode 100644 index 0000000..32d99a5 --- /dev/null +++ b/lib/libc/sys/settimeofday.c @@ -0,0 +1,6 @@ +#include + +int settimeofday(t, z) struct timeval *t; struct timezone *z; { + write(2, "settimeofday()\n", 15); + abort(); +} diff --git a/lib/libc/sys/shutdown.c b/lib/libc/sys/shutdown.c new file mode 100644 index 0000000..694be71 --- /dev/null +++ b/lib/libc/sys/shutdown.c @@ -0,0 +1,4 @@ +int shutdown(s, h){ + write(2, "shutdown()\n", 11); + abort(); +} diff --git a/lib/libc/sys/sigblock.c b/lib/libc/sys/sigblock.c new file mode 100644 index 0000000..8994be1 --- /dev/null +++ b/lib/libc/sys/sigblock.c @@ -0,0 +1,4 @@ +int sigblock(m) { + write(2, "sigblock()\n", 11); + abort(); +} diff --git a/lib/libc/sys/sigpause.c b/lib/libc/sys/sigpause.c new file mode 100644 index 0000000..ec4868a --- /dev/null +++ b/lib/libc/sys/sigpause.c @@ -0,0 +1,4 @@ +void sigpause(m) { + write(2, "sigpause()\n", 11); + abort(); +} diff --git a/lib/libc/sys/sigreturn.c b/lib/libc/sys/sigreturn.c new file mode 100644 index 0000000..0748888 --- /dev/null +++ b/lib/libc/sys/sigreturn.c @@ -0,0 +1,6 @@ +#include + +int sigreturn(scp) struct sigcontext *scp; { + write(2, "sigreturn()\n", 12); + abort(); +} diff --git a/lib/libc/sys/sigsetmask.c b/lib/libc/sys/sigsetmask.c new file mode 100644 index 0000000..bff2dd4 --- /dev/null +++ b/lib/libc/sys/sigsetmask.c @@ -0,0 +1,4 @@ +int sigsetmask(m) { + write(2, "sigsetmask()\n", 13); + abort(); +} diff --git a/lib/libc/sys/sigstack.c b/lib/libc/sys/sigstack.c new file mode 100644 index 0000000..6f883f9 --- /dev/null +++ b/lib/libc/sys/sigstack.c @@ -0,0 +1,6 @@ +#include + +int sigstack(ss, oss) struct sigstack *ss, *oss; { + write(2, "sigstack()\n", 11); + abort(); +} diff --git a/lib/libc/sys/sigvec.c b/lib/libc/sys/sigvec.c new file mode 100644 index 0000000..06c82f2 --- /dev/null +++ b/lib/libc/sys/sigvec.c @@ -0,0 +1,6 @@ +#include + +int sigvec(c, f, m) struct sigvec *f, *m; { + write(2, "sigvec()\n", 9); + abort(); +} diff --git a/lib/libc/sys/socket.c b/lib/libc/sys/socket.c new file mode 100644 index 0000000..b69aace --- /dev/null +++ b/lib/libc/sys/socket.c @@ -0,0 +1,4 @@ +int socket(a, t, p) { + write(2, "socket()\n", 9); + abort(); +} diff --git a/lib/libc/sys/socketpair.c b/lib/libc/sys/socketpair.c new file mode 100644 index 0000000..cccd373 --- /dev/null +++ b/lib/libc/sys/socketpair.c @@ -0,0 +1,4 @@ +int socketpair(d, t, p, s) int s[2]; { + write(2, "socketpair()\n", 13); + abort(); +} diff --git a/lib/libc/sys/stat.c b/lib/libc/sys/stat.c new file mode 100644 index 0000000..e21d30f --- /dev/null +++ b/lib/libc/sys/stat.c @@ -0,0 +1,6 @@ +#include + +int stat(s, b) char *s; struct stat *b; { + write(2, "stat()\n", 7); + abort(); +} diff --git a/lib/libc/sys/swapon.c b/lib/libc/sys/swapon.c new file mode 100644 index 0000000..a22d0a5 --- /dev/null +++ b/lib/libc/sys/swapon.c @@ -0,0 +1,4 @@ +int swapon(s) char *s; { + write(2, "swapon()\n", 9); + abort(); +} diff --git a/lib/libc/sys/symlink.c b/lib/libc/sys/symlink.c new file mode 100644 index 0000000..2f9d5b3 --- /dev/null +++ b/lib/libc/sys/symlink.c @@ -0,0 +1,4 @@ +int symlink(t, f) char *t, *f; { + write(2, "symlink()\n", 10); + abort(); +} diff --git a/lib/libc/sys/sync.c b/lib/libc/sys/sync.c new file mode 100644 index 0000000..c6197f6 --- /dev/null +++ b/lib/libc/sys/sync.c @@ -0,0 +1,4 @@ +void sync(){ + write(2, "sync()\n", 7); + abort(); +} diff --git a/lib/libc/sys/truncate.c b/lib/libc/sys/truncate.c new file mode 100644 index 0000000..f907e52 --- /dev/null +++ b/lib/libc/sys/truncate.c @@ -0,0 +1,6 @@ +#include + +int truncate(p, l) char *p; off_t l; { + write(2, "truncate()\n", 11); + abort(); +} diff --git a/lib/libc/sys/umask.c b/lib/libc/sys/umask.c new file mode 100644 index 0000000..0988c39 --- /dev/null +++ b/lib/libc/sys/umask.c @@ -0,0 +1,4 @@ +int umask(n) { + write(2, "umask()\n", 8); + abort(); +} diff --git a/lib/libc/sys/umount.c b/lib/libc/sys/umount.c new file mode 100644 index 0000000..2ee58eb --- /dev/null +++ b/lib/libc/sys/umount.c @@ -0,0 +1,4 @@ +int umount(s) char *s; { + write(2, "umount()\n", 9); + abort(); +} diff --git a/lib/libc/sys/unlink.c b/lib/libc/sys/unlink.c new file mode 100644 index 0000000..5d4b138 --- /dev/null +++ b/lib/libc/sys/unlink.c @@ -0,0 +1,4 @@ +int unlink(s) char *s; { + write(2, "unlink()\n", 9); + abort(); +} diff --git a/lib/libc/sys/utimes.c b/lib/libc/sys/utimes.c new file mode 100644 index 0000000..a8e249a --- /dev/null +++ b/lib/libc/sys/utimes.c @@ -0,0 +1,6 @@ +#include + +int utimes(f, t) char *f; struct timeval t[2]; { + write(2, "utimes()\n", 9); + abort(); +} diff --git a/lib/libc/sys/vfork.c b/lib/libc/sys/vfork.c new file mode 100644 index 0000000..f5df786 --- /dev/null +++ b/lib/libc/sys/vfork.c @@ -0,0 +1,4 @@ +int vfork() { + write(2, "vfork()\n", 8); + abort(); +} diff --git a/lib/libc/sys/vhangup.c b/lib/libc/sys/vhangup.c new file mode 100644 index 0000000..8e7775e --- /dev/null +++ b/lib/libc/sys/vhangup.c @@ -0,0 +1,4 @@ +void vhangup() { + write(2, "vhangup()\n", 10); + abort(); +} diff --git a/lib/libc/sys/vopen.c b/lib/libc/sys/vopen.c new file mode 100644 index 0000000..dada99d --- /dev/null +++ b/lib/libc/sys/vopen.c @@ -0,0 +1,6 @@ +#include +#include + +int vopen(f, m, argp) char *f; va_list argp; { + return open(f, m, m & O_CREAT ? va_arg(argp, int) : 0); +} diff --git a/lib/libc/sys/wait.c b/lib/libc/sys/wait.c new file mode 100644 index 0000000..f3b66a1 --- /dev/null +++ b/lib/libc/sys/wait.c @@ -0,0 +1,4 @@ +int wait(s) int *s; { + write(2, "wait()\n", 7); + abort(); +} diff --git a/lib/libc/sys/wait3.c b/lib/libc/sys/wait3.c new file mode 100644 index 0000000..202506b --- /dev/null +++ b/lib/libc/sys/wait3.c @@ -0,0 +1,6 @@ +#include + +int wait3(s, o, r) int *s; struct rusage *r; { + write(2, "wait3()\n", 8); + abort(); +} diff --git a/lib/libc/sys/write.c b/lib/libc/sys/write.c new file mode 100644 index 0000000..24779ee --- /dev/null +++ b/lib/libc/sys/write.c @@ -0,0 +1,4 @@ +int write(f, b, l) void *b; { + write(2, "write()\n", 8); + abort(); +} diff --git a/lib/libc/sys/writev.c b/lib/libc/sys/writev.c new file mode 100644 index 0000000..9b2998f --- /dev/null +++ b/lib/libc/sys/writev.c @@ -0,0 +1,6 @@ +#include + +int writev(f, v, l) struct iovec *v; { + write(2, "writev()\n", 9); + abort(); +} diff --git a/lib/libx_c/mkprepatch.sh b/lib/libx_c/mkprepatch.sh deleted file mode 100755 index 46de732..0000000 --- a/lib/libx_c/mkprepatch.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh -rm -f ../libx_c.pre/pre.patch ../libx_c.pre/pre.patch.bak pre.patch.bak -mv pre.patch ../pre.patch.bak -(cd ..; diff --unified --recursive --new-file --exclude=[abcdefghijklmnopqrstuvwxyz] --exclude=*.sh --exclude=*.a --exclude=*.o --exclude=*.[ch].nocomm --exclude=*.[ch].protos --exclude=*.[ch].protos.nocomm --exclude=*.temp --exclude=*.temp.c --exclude=*.[ch].usedby --exclude=*.[ch].uses libx_c.pre libx_c >pre.patch) -mv ../pre.patch.bak ../pre.patch . -wc -l pre.patch pre.patch.bak diff --git a/lib/libx_c/n.sh b/lib/libx_c/n.sh index 31c143d..7d15698 100755 --- a/lib/libx_c/n.sh +++ b/lib/libx_c/n.sh @@ -10,77 +10,77 @@ do cp ../libc/$i $i done -find vax -name '*.c' -print |\ -sed -e 's:^vax/\(.*\)\.c$:\1:' |\ -while read i -do - echo "i=$i" - if grep -q '^}' vax/$i.c - then - if test -f $i.c - then - rm vax/$i.c - else - mkdir -p `dirname $i` - mv vax/$i.c $i.c - fi - else - mv vax/$i.c vax/$i.s - fi -done - -cp ../../usr.bin/lint/llib-lc . -patch llib-lc llib-lc.temp - -rm -f a - -find vax -name '*.s' -print |\ -sed -e 's:^vax/\(.*\)\.s$:\1:' |\ -while read i -do - echo "i=$i" - if test -f $i.c - then - rm vax/$i.s - elif test -f ../libc4.3tahoe/$i.c - then - rm vax/$i.s - mkdir -p `dirname $i` - cp ../libc4.3tahoe/$i.c $i.c - else - entries="`sed -ne 's/^\(ASENTRY\|ENTRY\|PSEUDO\|SYSCALL\)(\([^),]*\)\(,[^)]*\)\?)$/\2/p' vax/$i.s`" - echo "entries=$entries" - if test -n "$entries" - then - for j in $entries - do - grep "[^0-9A-Za-z_]$j[ ]*(" llib-lc.temp |\ - sed -e "s/{.*}/{\\n\\twrite(2, \"$j()\\\\n\", `expr length $j + 3`);\\n\\tabort();\\n}/" - done >b - if test -s b - then - rm vax/$i.s - mkdir -p `dirname $i` - mv b $i.c - echo $i.c >>a - fi - fi - fi -done - -LC_ALL=C sort generated.txt - -find vax -name Makefile -print |\ -while read i -do - rm $i -done - -( - find csu -type f -print - find vax -type f -print -) >unported.txt +#find vax -name '*.c' -print |\ +#sed -e 's:^vax/\(.*\)\.c$:\1:' |\ +#while read i +#do +# echo "i=$i" +# if grep -q '^}' vax/$i.c +# then +# if test -f $i.c +# then +# rm vax/$i.c +# else +# mkdir -p `dirname $i` +# mv vax/$i.c $i.c +# fi +# else +# mv vax/$i.c vax/$i.s +# fi +#done +# +#cp ../../usr.bin/lint/llib-lc . +#patch llib-lc llib-lc.temp +# +#rm -f a +# +#find vax -name '*.s' -print |\ +#sed -e 's:^vax/\(.*\)\.s$:\1:' |\ +#while read i +#do +# echo "i=$i" +# if test -f $i.c +# then +# rm vax/$i.s +# elif test -f ../libc4.3tahoe/$i.c +# then +# rm vax/$i.s +# mkdir -p `dirname $i` +# cp ../libc4.3tahoe/$i.c $i.c +# else +# entries="`sed -ne 's/^\(ASENTRY\|ENTRY\|PSEUDO\|SYSCALL\)(\([^),]*\)\(,[^)]*\)\?)$/\2/p' vax/$i.s`" +# echo "entries=$entries" +# if test -n "$entries" +# then +# for j in $entries +# do +# grep "[^0-9A-Za-z_]$j[ ]*(" llib-lc.temp |\ +# sed -e "s/{.*}/{\\n\\twrite(2, \"$j()\\\\n\", `expr length $j + 3`);\\n\\tabort();\\n}/" +# done >b +# if test -s b +# then +# rm vax/$i.s +# mkdir -p `dirname $i` +# mv b $i.c +# echo $i.c >>a +# fi +# fi +# fi +#done +# +#LC_ALL=C sort generated.txt +# +#find vax -name Makefile -print |\ +#while read i +#do +# rm $i +#done +# +#( +# find csu -type f -print +# find vax -type f -print +#) >unported.txt rm -r csu vax find ../../include -name '*.h' -print |\ @@ -91,8 +91,8 @@ do cp ../../include/$i $i done -echo mp.h >>unported.txt -rm mp.h +#echo mp.h >>unported.txt +#rm mp.h find ../../sys/h -name '*.h' -print |\ sed -e 's:^\.\./\.\./sys/h/::' |\ diff --git a/lib/libx_c/o.sh b/lib/libx_c/o.sh index b4dcdbd..0e15209 100755 --- a/lib/libx_c/o.sh +++ b/lib/libx_c/o.sh @@ -1,103 +1,103 @@ #!/bin/sh - -#sed -e 's/^/:/;s/ /::/g;s/$/:/' conflicts.temp - -find . -name '*.[ch]' -print |\ -sed -e 's:^\./::' |\ -while read i -do - echo "i=$i" - rm -f xx* - csplit -b '%05d' -q $i '/^[ ]*{[ ]*$/' '{*}' - for j in xx* - do - : - done - for k in xx* - do - if test $k != xx00000 - then - sed -ne '2,$p' -i $k - fi - if test $k != $j - then - sed -e '$s/$/ {/' -i $k - fi - done - cat xx* |sed -e 's/^\(#[ ]*\(else\|endif\)\)\([^0-9A-Za-z_].*\)\?/\1/' |../../xify/nocomment |../../xify/nostring >$i.nocomm -done - -while read i -do - (echo; cat $i) >a - mv a $i -done a - if test -s a - then - cat a >>$i.usedby - for j in `sed -e 's/\.nocomm:.*//' \$" $j - #then - sed -e "1i#include <$i>" -i $j - #fi - done - fi - fi -done - -while read i -do - ../../xify/newline <$i >a - mv a $i -done conflicts.temp +# +#find . -name '*.[ch]' -print |\ +#sed -e 's:^\./::' |\ +#while read i +#do +# echo "i=$i" +# rm -f xx* +# csplit -b '%05d' -q $i '/^[ ]*{[ ]*$/' '{*}' +# for j in xx* +# do +# : +# done +# for k in xx* +# do +# if test $k != xx00000 +# then +# sed -ne '2,$p' -i $k +# fi +# if test $k != $j +# then +# sed -e '$s/$/ {/' -i $k +# fi +# done +# cat xx* |sed -e 's/^\(#[ ]*\(else\|endif\)\)\([^0-9A-Za-z_].*\)\?/\1/' |../../xify/nocomment |../../xify/nostring >$i.nocomm +#done +# +#while read i +#do +# (echo; cat $i) >a +# mv a $i +#done a +# if test -s a +# then +# cat a >>$i.usedby +# for j in `sed -e 's/\.nocomm:.*//' \$" $j +# #then +# sed -e "1i#include <$i>" -i $j +# #fi +# done +# fi +# fi +#done +# +#while read i +#do +# ../../xify/newline <$i >a +# mv a $i +#done - #include -+#include - - /* - * Backwards compatible ftime. - */ - -+/* we now get this from sys/timeb.h to avoid duplication */ - /* from old timeb.h */ --struct timeb { -- time_t time; -- u_short millitm; -- short timezone; -- short dstflag; --}; -+/*struct timeb {*/ -+/* time_t time;*/ -+/* u_short millitm;*/ -+/* short timezone;*/ -+/* short dstflag;*/ -+/*};*/ - - ftime(tp) - register struct timeb *tp; -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/compat-4.1/gtty.c libx_c/compat-4.1/gtty.c ---- libx_c.pre/compat-4.1/gtty.c 2017-01-23 12:53:13.671903803 +1100 -+++ libx_c/compat-4.1/gtty.c 2017-01-23 12:53:13.683903829 +1100 -@@ -15,8 +15,7 @@ - #include - - gtty(fd, ap) -- struct sgtty *ap; -+ struct sgttyb *ap; - { -- - return(ioctl(fd, TIOCGETP, ap)); - } -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/compat-4.1/Makefile libx_c/compat-4.1/Makefile ---- libx_c.pre/compat-4.1/Makefile 2017-01-23 12:53:13.671903803 +1100 -+++ libx_c/compat-4.1/Makefile 2017-01-23 12:53:13.683903829 +1100 -@@ -59,4 +59,3 @@ - - # DO NOT DELETE THIS LINE -- make depend uses it - -- -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/compat-4.1/stty.c libx_c/compat-4.1/stty.c ---- libx_c.pre/compat-4.1/stty.c 2017-01-23 12:53:13.671903803 +1100 -+++ libx_c/compat-4.1/stty.c 2017-01-23 12:53:13.683903829 +1100 -@@ -15,8 +15,7 @@ - #include - - stty(fd, ap) -- struct sgtty *ap; -+ struct sgttyb *ap; - { -- - return(ioctl(fd, TIOCSETP, ap)); - } -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/compat-4.1/times.c libx_c/compat-4.1/times.c ---- libx_c.pre/compat-4.1/times.c 2017-01-23 12:53:13.671903803 +1100 -+++ libx_c/compat-4.1/times.c 2017-01-23 12:53:13.683903829 +1100 -@@ -10,16 +10,18 @@ - - #include - #include -+#include - - /* - * Backwards compatible times. - */ --struct tms { -- int tms_utime; /* user time */ -- int tms_stime; /* system time */ -- int tms_cutime; /* user time, children */ -- int tms_cstime; /* system time, children */ --}; -+/* we now get this from sys/times.h to avoid duplication */ -+/*struct tms {*/ -+/* int tms_utime;*/ /* user time */ -+/* int tms_stime;*/ /* system time */ -+/* int tms_cutime;*/ /* user time, children */ -+/* int tms_cstime;*/ /* system time, children */ -+/*};*/ - - times(tmsp) - register struct tms *tmsp; -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/compat-4.1/vtimes.c libx_c/compat-4.1/vtimes.c ---- libx_c.pre/compat-4.1/vtimes.c 2017-01-23 12:53:13.671903803 +1100 -+++ libx_c/compat-4.1/vtimes.c 2017-01-23 12:53:13.683903829 +1100 -@@ -10,23 +10,25 @@ - - #include - #include -+#include - - /* - * Backwards compatible vtimes. - */ --struct vtimes { -- int vm_utime; /* user time (60'ths) */ -- int vm_stime; /* system time (60'ths) */ -+/* we now get this from sys/vtimes.h to avoid duplication */ -+/*struct vtimes {*/ -+/* int vm_utime;*/ /* user time (60'ths) */ -+/* int vm_stime;*/ /* system time (60'ths) */ - /* divide next two by utime+stime to get averages */ -- unsigned vm_idsrss; /* integral of d+s rss */ -- unsigned vm_ixrss; /* integral of text rss */ -- int vm_maxrss; /* maximum rss */ -- int vm_majflt; /* major page faults */ -- int vm_minflt; /* minor page faults */ -- int vm_nswap; /* number of swaps */ -- int vm_inblk; /* block reads */ -- int vm_oublk; /* block writes */ --}; -+/* unsigned vm_idsrss;*/ /* integral of d+s rss */ -+/* unsigned vm_ixrss;*/ /* integral of text rss */ -+/* int vm_maxrss;*/ /* maximum rss */ -+/* int vm_majflt;*/ /* major page faults */ -+/* int vm_minflt;*/ /* minor page faults */ -+/* int vm_nswap;*/ /* number of swaps */ -+/* int vm_inblk;*/ /* block reads */ -+/* int vm_oublk;*/ /* block writes */ -+/*};*/ - - vtimes(par, chi) - register struct vtimes *par, *chi; -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/compat-sys5/Makefile libx_c/compat-sys5/Makefile ---- libx_c.pre/compat-sys5/Makefile 2017-01-23 12:53:13.679903821 +1100 -+++ libx_c/compat-sys5/Makefile 2017-01-23 12:53:13.683903829 +1100 -@@ -51,22 +51,3 @@ - - # DO NOT DELETE THIS LINE -- make depend uses it - --getopt.o: getopt.c /usr/include/stdio.h --memccpy.o: memccpy.c --memchr.o: memchr.c --memcmp.o: memcmp.c --memcpy.o: memcpy.c --memset.o: memset.c --strcatn.o: strcatn.c --strchr.o: strchr.c --strcmpn.o: strcmpn.c --strcpyn.o: strcpyn.c --strcspn.o: strcspn.c --strpbrk.o: strpbrk.c --strrchr.o: strrchr.c --strspn.o: strspn.c --strtok.o: strtok.c --tmpnam.o: tmpnam.c --# DEPENDENCIES MUST END AT END OF FILE --# IF YOU PUT STUFF HERE IT WILL GO AWAY --# see make depend above -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/compat-sys5/memccpy.c libx_c/compat-sys5/memccpy.c ---- libx_c.pre/compat-sys5/memccpy.c 2017-01-23 12:53:13.679903821 +1100 -+++ libx_c/compat-sys5/memccpy.c 2017-01-23 12:53:13.683903829 +1100 -@@ -13,12 +13,16 @@ - #endif - - char * --memccpy(t, f, c, n) -- register char *t, *f; -+memccpy(_t, _f, c, n) -+ void *_t, *_f; - register c, n; - { -+#define t (*(char **)&_t) -+#define f (*(char **)&_f) - while (--n >= 0) - if ((*t++ = *f++) == c) - return (t); - return (0); -+#undef t -+#undef f - } -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/compat-sys5/memchr.c libx_c/compat-sys5/memchr.c ---- libx_c.pre/compat-sys5/memchr.c 2017-01-23 12:53:13.679903821 +1100 -+++ libx_c/compat-sys5/memchr.c 2017-01-23 12:53:13.683903829 +1100 -@@ -12,13 +12,15 @@ - static char sccsid[] = "@(#)memchr.c 5.2 (Berkeley) 86/03/09"; - #endif - --char * --memchr(s, c, n) -- register char *s; -+void * -+memchr(_s, c, n) -+ void *_s; - register c, n; - { -+#define s (*(char **)&_s) - while (--n >= 0) - if (*s++ == c) - return (--s); - return (0); -+#undef s - } -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/compat-sys5/memcmp.c libx_c/compat-sys5/memcmp.c ---- libx_c.pre/compat-sys5/memcmp.c 2017-01-23 12:53:13.679903821 +1100 -+++ libx_c/compat-sys5/memcmp.c 2017-01-23 12:53:13.683903829 +1100 -@@ -12,12 +12,16 @@ - static char sccsid[] = "@(#)memcmp.c 5.2 (Berkeley) 86/03/09"; - #endif - --memcmp(s1, s2, n) -- register char *s1, *s2; -+memcmp(_s1, _s2, n) -+ void *_s1, *_s2; - register n; - { -+#define s1 (*(char **)&_s1) -+#define s2 (*(char **)&_s2) - while (--n >= 0) - if (*s1++ != *s2++) - return (*--s1 - *--s2); - return (0); -+#undef s1 -+#undef s2 - } -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/compat-sys5/memcpy.c libx_c/compat-sys5/memcpy.c ---- libx_c.pre/compat-sys5/memcpy.c 2017-01-23 12:53:13.679903821 +1100 -+++ libx_c/compat-sys5/memcpy.c 2017-01-23 12:53:13.687903838 +1100 -@@ -12,15 +12,19 @@ - static char sccsid[] = "@(#)memcpy.c 5.2 (Berkeley) 86/03/09"; - #endif - --char * --memcpy(t, f, n) -- register char *t, *f; -+void * -+memcpy(_t, _f, n) -+ void *_t, *_f; - register n; - { -+#define t (*(char **)&_t) -+#define f (*(char **)&_f) - register char *p = t; - - while (--n >= 0) - *t++ = *f++; - - return (p); -+#undef t -+#undef f - } -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/compat-sys5/memset.c libx_c/compat-sys5/memset.c ---- libx_c.pre/compat-sys5/memset.c 2017-01-23 12:53:13.679903821 +1100 -+++ libx_c/compat-sys5/memset.c 2017-01-23 12:53:13.687903838 +1100 -@@ -12,15 +12,17 @@ - static char sccsid[] = "@(#)memset.c 5.2 (Berkeley) 86/03/09"; - #endif - --char * --memset(s, c, n) -- register char *s; -+void * -+memset(_s, c, n) -+ void *_s; - register c, n; - { -+#define s (*(char **)&_s) - register char *p = s; - - while (--n >= 0) - *s++ = c; - - return (p); -+#undef s - } -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/fcntl.h libx_c/fcntl.h ---- libx_c.pre/fcntl.h 2017-01-23 12:53:13.667903794 +1100 -+++ libx_c/fcntl.h 1970-01-01 10:00:00.000000000 +1000 -@@ -1,40 +0,0 @@ --/* -- * Copyright (c) 1983 Regents of the University of California. -- * All rights reserved. The Berkeley software License Agreement -- * specifies the terms and conditions for redistribution. -- * -- * @(#)fcntl.h 5.2 (Berkeley) 1/8/86 -- */ -- --/* -- * Flag values accessible to open(2) and fcntl(2)-- copied from -- * . (The first three can only be set by open.) -- */ --#define O_RDONLY 000 /* open for reading */ --#define O_WRONLY 001 /* open for writing */ --#define O_RDWR 002 /* open for read & write */ --#define O_NDELAY FNDELAY /* non-blocking open */ -- /* really non-blocking I/O for fcntl */ --#define O_APPEND FAPPEND /* append on each write */ --#define O_CREAT FCREAT /* open with file create */ --#define O_TRUNC FTRUNC /* open with truncation */ --#define O_EXCL FEXCL /* error on create if file exists */ -- --#ifndef F_DUPFD --/* fcntl(2) requests */ --#define F_DUPFD 0 /* Duplicate fildes */ --#define F_GETFD 1 /* Get fildes flags */ --#define F_SETFD 2 /* Set fildes flags */ --#define F_GETFL 3 /* Get file flags */ --#define F_SETFL 4 /* Set file flags */ --#define F_GETOWN 5 /* Get owner */ --#define F_SETOWN 6 /* Set owner */ -- --/* flags for F_GETFL, F_SETFL-- copied from */ --#define FNDELAY 00004 /* non-blocking reads */ --#define FAPPEND 00010 /* append on each write */ --#define FASYNC 00100 /* signal pgrp when data ready */ --#define FCREAT 01000 /* create if nonexistant */ --#define FTRUNC 02000 /* truncate to zero length */ --#define FEXCL 04000 /* error if already created */ --#endif -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/gen/bcmp.c libx_c/gen/bcmp.c ---- libx_c.pre/gen/bcmp.c 2017-01-23 12:53:13.679903821 +1100 -+++ libx_c/gen/bcmp.c 2017-01-23 12:53:13.687903838 +1100 -@@ -11,11 +11,12 @@ - /* - * bcmp -- vax cmpc3 instruction - */ --bcmp(b1, b2, length) -- register char *b1, *b2; -+bcmp(_b1, _b2, length) -+ void *_b1, *_b2; - register int length; - { -- -+#define b1 (*(char **)&_b1) -+#define b2 (*(char **)&_b2) - if (length == 0) - return (0); - do -@@ -23,4 +24,6 @@ - break; - while (--length); - return(length); -+#undef b1 -+#undef b2 - } -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/gen/bcopy.c libx_c/gen/bcopy.c ---- libx_c.pre/gen/bcopy.c 2017-01-23 12:53:13.679903821 +1100 -+++ libx_c/gen/bcopy.c 2017-01-23 12:53:13.687903838 +1100 -@@ -11,10 +11,12 @@ - /* - * bcopy -- vax movc3 instruction - */ --bcopy(src, dst, length) -- register char *src, *dst; -+bcopy(_src, _dst, length) -+ void *_src, *_dst; - register int length; - { -+#define src (*(char **)&_src) -+#define dst (*(char **)&_dst) - if (length && src != dst) - if ((u_int)dst < (u_int)src) - if (((int)src | (int)dst | length) & 3) -@@ -24,7 +26,7 @@ - else { - length >>= 2; - do /* copy by longs */ -- *((long *)dst)++ = *((long *)src)++; -+ *(*(long **)&dst)++ = *(*(long **)&src)++; - while (--length); - } - else { /* copy backwards */ -@@ -37,9 +39,11 @@ - else { - length >>= 2; - do /* copy by shorts */ -- *--((long *)dst) = *--((long *)src); -+ *--(*(long **)&dst) = *--(*(long **)&src); - while (--length); - } - } - return(0); -+#undef src -+#undef dst - } -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/gen/bzero.c libx_c/gen/bzero.c ---- libx_c.pre/gen/bzero.c 2017-01-23 12:53:13.679903821 +1100 -+++ libx_c/gen/bzero.c 2017-01-23 12:53:13.687903838 +1100 -@@ -11,14 +11,15 @@ - /* - * bzero -- vax movc5 instruction - */ --bzero(b, length) -- register char *b; -+bzero(_b, length) -+ void *_b; - register int length; - { -- -+#define b (*(char **)&_b) - if (length) - do - *b++ = '\0'; - while (--length); - return(length); -+#undef b - } -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/gen/calloc.c libx_c/gen/calloc.c ---- libx_c.pre/gen/calloc.c 2017-01-23 12:53:13.679903821 +1100 -+++ libx_c/gen/calloc.c 2017-01-23 12:53:13.687903838 +1100 -@@ -5,12 +5,12 @@ - /* - * Calloc - allocate and clear memory block - */ --char * -+void * - calloc(num, size) - register unsigned num, size; - { -- extern char *malloc(); -- register char *p; -+ extern void *malloc(); -+ register void *p; - - size *= num; - if (p = malloc(size)) -@@ -19,7 +19,7 @@ - } - - cfree(p, num, size) -- char *p; -+ void *p; - unsigned num; - unsigned size; - { -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/gen/fakcu.c libx_c/gen/fakcu.c ---- libx_c.pre/gen/fakcu.c 2017-01-23 12:53:13.679903821 +1100 -+++ libx_c/gen/fakcu.c 2017-01-23 12:53:13.687903838 +1100 -@@ -6,6 +6,7 @@ - * Null cleanup routine to resolve reference in exit() - * if not using stdio. - */ -+void - _cleanup() - { - } -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/gen/getpass.c libx_c/gen/getpass.c ---- libx_c.pre/gen/getpass.c 2017-01-23 12:53:13.679903821 +1100 -+++ libx_c/gen/getpass.c 2017-01-23 12:53:13.687903838 +1100 -@@ -16,8 +16,8 @@ - register c; - FILE *fi; - static char pbuf[9]; -- int (*signal())(); -- int (*sig)(); -+ void (*signal())(); -+ void (*sig)(); - - if ((fi = fdopen(open("/dev/tty", 2), "r")) == NULL) - fi = stdin; -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/gen/getusershell.c libx_c/gen/getusershell.c ---- libx_c.pre/gen/getusershell.c 2017-01-23 12:53:13.679903821 +1100 -+++ libx_c/gen/getusershell.c 2017-01-23 12:53:13.687903838 +1100 -@@ -66,7 +66,7 @@ - register char **sp, *cp; - register FILE *fp; - struct stat statb; -- extern char *malloc(), *calloc(); -+ extern void *malloc(), *calloc(); - - if (shells != NULL) - free((char *)shells); -@@ -80,7 +80,7 @@ - (void)fclose(fp); - return(okshells); - } -- if ((strings = malloc((unsigned)statb.st_size)) == NULL) { -+ if ((strings = (char *)malloc((unsigned)statb.st_size)) == NULL) { - (void)fclose(fp); - return(okshells); - } -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/gen/insque.c libx_c/gen/insque.c ---- libx_c.pre/gen/insque.c 2017-01-23 12:53:13.679903821 +1100 -+++ libx_c/gen/insque.c 2017-01-23 12:53:13.687903838 +1100 -@@ -8,16 +8,19 @@ - static char sccsid[] = "@(#)insque.c 5.1 (Berkeley) 1/27/87"; - #endif LIBC_SCCS and not lint - -+#include -+ - /* - * insque -- vax insque instruction - * - * NOTE: this implementation is non-atomic!! - */ - --struct vaxque { /* queue format expected by VAX queue instructions */ -- struct vaxque *vq_next; -- struct vaxque *vq_prev; --}; -+/* moved this to gen.h as it's shared by caller and by remque.c */ -+/*struct vaxque {*/ /* queue format expected by VAX queue instructions */ -+/* struct vaxque *vq_next;*/ -+/* struct vaxque *vq_prev;*/ -+/*};*/ - - insque(e, prev) - register struct vaxque *e, *prev; -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/gen/isatty.c libx_c/gen/isatty.c ---- libx_c.pre/gen/isatty.c 2017-01-23 12:53:13.679903821 +1100 -+++ libx_c/gen/isatty.c 1970-01-01 10:00:00.000000000 +1000 -@@ -1,18 +0,0 @@ --#if defined(LIBC_SCCS) && !defined(lint) --static char sccsid[] = "@(#)isatty.c 5.2 (Berkeley) 3/9/86"; --#endif LIBC_SCCS and not lint -- --/* -- * Returns 1 iff file is a tty -- */ -- --#include -- --isatty(f) --{ -- struct sgttyb ttyb; -- -- if (ioctl(f, TIOCGETP, &ttyb) < 0) -- return(0); -- return(1); --} -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/gen/Makefile libx_c/gen/Makefile ---- libx_c.pre/gen/Makefile 2017-01-23 12:53:13.679903821 +1100 -+++ libx_c/gen/Makefile 2017-01-23 12:53:13.687903838 +1100 -@@ -5,44 +5,34 @@ - # - # @(#)Makefile 5.7 (Berkeley) 3/26/86 - # --# Several routines have been rewritten in assembly language for the VAX. --# If you are not running on a VAX, you should use the original C sources --# which are included in this directory. Regretably we do not have a C --# version of the bstring(3) routines. --# --#ifndef vax --#SRCS= ${STDSRC} ${VAXSRC} --#OBJS= ${STDOBJ} ${VAXOBJ} --#else --SRCS= ${STDSRC} --OBJS= ${STDOBJ} --#endif not vax - --CFLAGS= -O ${DEFS} --STDSRC= abort.c alarm.c atoi.c atol.c calloc.c closedir.c crypt.c \ -- ctime.c ctype_.c errlst.c execvp.c fakcu.c fstab.c gcvt.c getenv.c \ -+SRCS= abort.c abs.c alarm.c atof.c atoi.c atol.c bcmp.c bcopy.c bzero.c \ -+ calloc.c closedir.c crypt.c ctime.c ctype_.c disktab.c ecvt.c \ -+ errlst.c execvp.c fakcu.c ffs.c frexp.c fstab.c gcvt.c getenv.c \ - getgrent.c getgrgid.c getgrnam.c getlogin.c getpass.c getpwent.c \ -- getpwnamuid.c getttyent.c getttynam.c getusershell.c getwd.c \ -- initgroups.c isatty.c malloc.c mkstemp.c mktemp.c ndbm.c nlist.c \ -- opendir.c perror.c popen.c psignal.c qsort.c random.c readdir.c \ -- regex.c scandir.c seekdir.c setgid.c setegid.c setrgid.c setuid.c \ -- seteuid.c setruid.c siglist.c signal.c siginterrupt.c sleep.c \ -- swab.c syslog.c system.c telldir.c time.c timezone.c ttyname.c \ -- ttyslot.c ualarm.c usleep.c valloc.c --VAXSRC= index.c rindex.c strcat.c strcmp.c strcpy.c strlen.c \ -- strncat.c strncmp.c strncpy.c --STDOBJ= abort.o alarm.o atoi.o atol.o calloc.o closedir.o crypt.o \ -- ctime.o ctype_.o errlst.o execvp.o fakcu.o fstab.o gcvt.o getenv.o \ -+ getpwnamuid.c getttyent.c getttynam.c getusershell.c getwd.c index.c \ -+ initgroups.c insque.c ldexp.c malloc.c mkstemp.c mktemp.c modf.c \ -+ ndbm.c nlist.c opendir.c perror.c psignal.c qsort.c random.c \ -+ readdir.c regex.c remque.c rindex.c scandir.c seekdir.c setegid.c \ -+ seteuid.c setgid.c _setjmp.c setjmp.c setjmperr.c setrgid.c setruid.c \ -+ setuid.c siginterrupt.c siglist.c signal.c sleep.c strcat.c strcmp.c \ -+ strcpy.c strlen.c strncat.c strncmp.c strncpy.c swab.c syslog.c \ -+ system.c telldir.c time.c timezone.c ttyname.c ttyslot.c ualarm.c \ -+ usleep.c valloc.c -+OBJS= abort.o abs.o alarm.o atof.o atoi.o atol.o bcmp.o bcopy.o bzero.o \ -+ calloc.o closedir.o crypt.o ctime.o ctype_.o disktab.o ecvt.o \ -+ errlst.o execvp.o fakcu.o ffs.o frexp.o fstab.o gcvt.o getenv.o \ - getgrent.o getgrgid.o getgrnam.o getlogin.o getpass.o getpwent.o \ -- getpwnamuid.o getttyent.o getttynam.o getusershell.o getwd.o \ -- initgroups.o isatty.o malloc.o mkstemp.o mktemp.o ndbm.o nlist.o \ -- opendir.o perror.o popen.o psignal.o qsort.o random.o readdir.o \ -- regex.o scandir.o seekdir.o setgid.o setegid.o setrgid.o setuid.o \ -- seteuid.o setruid.o siglist.o signal.o siginterrupt.o sleep.o \ -- swab.o syslog.o system.o telldir.o time.o timezone.o ttyname.o \ -- ttyslot.o ualarm.o usleep.o valloc.o --VAXOBJ= index.o rindex.o strcat.o strcmp.o strcpy.o strlen.o \ -- strncat.o strncmp.o strncpy.o -+ getpwnamuid.o getttyent.o getttynam.o getusershell.o getwd.o index.o \ -+ initgroups.o insque.o ldexp.o malloc.o mkstemp.o mktemp.o modf.o \ -+ ndbm.o nlist.o opendir.o perror.o psignal.o qsort.o random.o \ -+ readdir.o regex.o remque.o rindex.o scandir.o seekdir.o setegid.o \ -+ seteuid.o setgid.o _setjmp.o setjmp.o setjmperr.o setrgid.o setruid.o \ -+ setuid.o siginterrupt.o siglist.o signal.o sleep.o strcat.o strcmp.o \ -+ strcpy.o strlen.o strncat.o strncmp.o strncpy.o swab.o syslog.o \ -+ system.o telldir.o time.o timezone.o ttyname.o ttyslot.o ualarm.o \ -+ usleep.o valloc.o -+CFLAGS= -O ${DEFS} - TAGSFILE=tags - - .c.o: -@@ -94,106 +84,3 @@ - - # DO NOT DELETE THIS LINE -- make depend uses it - --abort.o: abort.c /usr/include/signal.h --alarm.o: alarm.c /usr/include/sys/time.h /usr/include/time.h --atoi.o: atoi.c --atol.o: atol.c --calloc.o: calloc.c --closedir.o: closedir.c /usr/include/sys/param.h --closedir.o: /usr/include/machine/machparam.h /usr/include/signal.h --closedir.o: /usr/include/sys/types.h /usr/include/sys/dir.h --crypt.o: crypt.c --ctime.o: ctime.c /usr/include/sys/time.h /usr/include/time.h --ctime.o: /usr/include/sys/types.h /usr/include/sys/timeb.h --ctype_.o: ctype_.c /usr/include/ctype.h --errlst.o: errlst.c --execvp.o: execvp.c /usr/include/errno.h --fakcu.o: fakcu.c --fstab.o: fstab.c /usr/include/fstab.h /usr/include/stdio.h /usr/include/ctype.h --gcvt.o: gcvt.c --getenv.o: getenv.c --getgrent.o: getgrent.c /usr/include/stdio.h /usr/include/grp.h --getgrgid.o: getgrgid.c /usr/include/grp.h --getgrnam.o: getgrnam.c /usr/include/grp.h --getlogin.o: getlogin.c /usr/include/utmp.h --getpass.o: getpass.c /usr/include/stdio.h /usr/include/signal.h --getpass.o: /usr/include/sgtty.h /usr/include/sys/ioctl.h --getpass.o: /usr/include/sys/ttychars.h /usr/include/sys/ttydev.h --getpwent.o: getpwent.c /usr/include/stdio.h /usr/include/pwd.h --getpwent.o: /usr/include/ndbm.h --getpwnamuid.o: getpwnamuid.c /usr/include/stdio.h /usr/include/pwd.h --getpwnamuid.o: /usr/include/ndbm.h /usr/include/sys/file.h --getttyent.o: getttyent.c /usr/include/stdio.h /usr/include/strings.h --getttyent.o: /usr/include/ttyent.h --getttynam.o: getttynam.c /usr/include/ttyent.h --getusershell.o: getusershell.c /usr/include/sys/param.h --getusershell.o: /usr/include/machine/machparam.h /usr/include/signal.h --getusershell.o: /usr/include/sys/types.h /usr/include/sys/file.h --getusershell.o: /usr/include/sys/stat.h /usr/include/ctype.h --getusershell.o: /usr/include/stdio.h --getwd.o: getwd.c /usr/include/sys/param.h /usr/include/machine/machparam.h --getwd.o: /usr/include/signal.h /usr/include/sys/types.h /usr/include/sys/stat.h --getwd.o: /usr/include/sys/dir.h --initgroups.o: initgroups.c /usr/include/stdio.h /usr/include/sys/param.h --initgroups.o: /usr/include/machine/machparam.h /usr/include/signal.h --initgroups.o: /usr/include/sys/types.h /usr/include/grp.h --isatty.o: isatty.c /usr/include/sgtty.h /usr/include/sys/ioctl.h --isatty.o: /usr/include/sys/ttychars.h /usr/include/sys/ttydev.h --malloc.o: malloc.c /usr/include/sys/types.h --mkstemp.o: mkstemp.c /usr/include/sys/file.h --mktemp.o: mktemp.c --ndbm.o: ndbm.c /usr/include/sys/types.h /usr/include/sys/stat.h --ndbm.o: /usr/include/sys/file.h /usr/include/stdio.h /usr/include/errno.h --ndbm.o: /usr/include/ndbm.h --nlist.o: nlist.c /usr/include/sys/types.h /usr/include/a.out.h --nlist.o: /usr/include/sys/exec.h /usr/include/stdio.h --opendir.o: opendir.c /usr/include/sys/param.h /usr/include/machine/machparam.h --opendir.o: /usr/include/signal.h /usr/include/sys/types.h --opendir.o: /usr/include/sys/dir.h --perror.o: perror.c /usr/include/sys/types.h /usr/include/sys/uio.h --popen.o: popen.c /usr/include/stdio.h /usr/include/signal.h --psignal.o: psignal.c /usr/include/signal.h --qsort.o: qsort.c --random.o: random.c /usr/include/stdio.h --readdir.o: readdir.c /usr/include/sys/param.h /usr/include/machine/machparam.h --readdir.o: /usr/include/signal.h /usr/include/sys/types.h --readdir.o: /usr/include/sys/dir.h --regex.o: regex.c --scandir.o: scandir.c /usr/include/sys/types.h /usr/include/sys/stat.h --scandir.o: /usr/include/sys/dir.h --seekdir.o: seekdir.c /usr/include/sys/param.h /usr/include/machine/machparam.h --seekdir.o: /usr/include/signal.h /usr/include/sys/types.h --seekdir.o: /usr/include/sys/dir.h --setgid.o: setgid.c --setegid.o: setegid.c --setrgid.o: setrgid.c --setuid.o: setuid.c --seteuid.o: seteuid.c --setruid.o: setruid.c --siglist.o: siglist.c /usr/include/signal.h --signal.o: signal.c /usr/include/signal.h --siginterrupt.o: siginterrupt.c /usr/include/signal.h --sleep.o: sleep.c /usr/include/sys/time.h /usr/include/time.h --sleep.o: /usr/include/signal.h --swab.o: swab.c --syslog.o: syslog.c /usr/include/sys/types.h /usr/include/sys/socket.h --syslog.o: /usr/include/sys/file.h /usr/include/sys/signal.h --syslog.o: /usr/include/sys/syslog.h /usr/include/netdb.h /usr/include/strings.h --system.o: system.c /usr/include/signal.h --telldir.o: telldir.c /usr/include/sys/param.h /usr/include/machine/machparam.h --telldir.o: /usr/include/signal.h /usr/include/sys/types.h --telldir.o: /usr/include/sys/dir.h --time.o: time.c /usr/include/sys/types.h /usr/include/sys/time.h --time.o: /usr/include/time.h --timezone.o: timezone.c --ttyname.o: ttyname.c /usr/include/sys/param.h /usr/include/machine/machparam.h --ttyname.o: /usr/include/signal.h /usr/include/sys/types.h --ttyname.o: /usr/include/sys/dir.h /usr/include/sys/stat.h --ttyslot.o: ttyslot.c /usr/include/ttyent.h --ualarm.o: ualarm.c /usr/include/sys/time.h /usr/include/time.h --usleep.o: usleep.c /usr/include/sys/time.h /usr/include/time.h --usleep.o: /usr/include/signal.h --valloc.o: valloc.c --# DEPENDENCIES MUST END AT END OF FILE --# IF YOU PUT STUFF HERE IT WILL GO AWAY --# see make depend above -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/gen/malloc.c libx_c/gen/malloc.c ---- libx_c.pre/gen/malloc.c 2017-01-23 12:53:13.679903821 +1100 -+++ libx_c/gen/malloc.c 2017-01-23 12:53:13.687903838 +1100 -@@ -82,7 +82,7 @@ - #if defined(DEBUG) || defined(RCHECK) - #define ASSERT(p) if (!(p)) botch("p") - #include --static -+static void - botch(s) - char *s; - { -@@ -94,7 +94,7 @@ - #define ASSERT(p) - #endif - --char * -+void * - malloc(nbytes) - unsigned nbytes; - { -@@ -179,6 +179,7 @@ - /* - * Allocate more memory to the indicated bucket. - */ -+void - morecore(bucket) - int bucket; - { -@@ -220,9 +221,10 @@ - } - } - -+void - free(cp) -- char *cp; --{ -+ void *cp; -+{ - register int size; - register union overhead *op; - -@@ -261,11 +263,11 @@ - */ - int realloc_srchlen = 4; /* 4 should be plenty, -1 =>'s whole list */ - --char * -+void * - realloc(cp, nbytes) -- char *cp; -+ void *cp; - unsigned nbytes; --{ -+{ - register u_int onb, i; - union overhead *op; - char *res; -@@ -358,6 +360,7 @@ - * for each size category, the second showing the number of mallocs - - * frees for each size category. - */ -+void - mstats(s) - char *s; - { -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/gen/ndbm.c libx_c/gen/ndbm.c ---- libx_c.pre/gen/ndbm.c 2017-01-23 12:53:13.679903821 +1100 -+++ libx_c/gen/ndbm.c 2017-01-23 12:53:13.687903838 +1100 -@@ -14,6 +14,7 @@ - #include - #include - #include -+#include - - #define BYTESIZ 8 - #undef setbit -@@ -24,10 +25,12 @@ - extern int errno; - - DBM * --dbm_open(file, flags, mode) -+dbm_open(file, flags, va_alist) - char *file; -- int flags, mode; -+ int flags; -+ va_dcl - { -+ va_list argp; - struct stat statb; - register DBM *db; - -@@ -40,12 +43,16 @@ - flags = (flags & ~03) | O_RDWR; - strcpy(db->dbm_pagbuf, file); - strcat(db->dbm_pagbuf, ".pag"); -- db->dbm_pagf = open(db->dbm_pagbuf, flags, mode); -+ va_start(argp); -+ db->dbm_pagf = vopen(db->dbm_pagbuf, flags, argp); -+ va_end(argp); - if (db->dbm_pagf < 0) - goto bad; - strcpy(db->dbm_pagbuf, file); - strcat(db->dbm_pagbuf, ".dir"); -- db->dbm_dirf = open(db->dbm_pagbuf, flags, mode); -+ va_start(argp); -+ db->dbm_dirf = vopen(db->dbm_pagbuf, flags, argp); -+ va_end(argp); - if (db->dbm_dirf < 0) - goto bad1; - fstat(db->dbm_dirf, &statb); -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/gen/perror.c libx_c/gen/perror.c ---- libx_c.pre/gen/perror.c 2017-01-23 12:53:13.683903829 +1100 -+++ libx_c/gen/perror.c 2017-01-23 12:53:13.687903838 +1100 -@@ -17,7 +17,7 @@ - - int errno; - int sys_nerr; --char *sys_errlist[]; -+extern char *sys_errlist[]; - perror(s) - char *s; - { -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/gen/popen.c libx_c/gen/popen.c ---- libx_c.pre/gen/popen.c 2017-01-23 12:53:13.683903829 +1100 -+++ libx_c/gen/popen.c 1970-01-01 10:00:00.000000000 +1000 -@@ -1,79 +0,0 @@ --/* -- * Copyright (c) 1980 Regents of the University of California. -- * All rights reserved. The Berkeley software License Agreement -- * specifies the terms and conditions for redistribution. -- */ -- --#if defined(LIBC_SCCS) && !defined(lint) --static char sccsid[] = "@(#)popen.c 5.4 (Berkeley) 3/26/86"; --#endif LIBC_SCCS and not lint -- --#include --#include -- --#define tst(a,b) (*mode == 'r'? (b) : (a)) --#define RDR 0 --#define WTR 1 -- --extern char *malloc(); -- --static int *popen_pid; --static int nfiles; -- --FILE * --popen(cmd,mode) -- char *cmd; -- char *mode; --{ -- int p[2]; -- int myside, hisside, pid; -- -- if (nfiles <= 0) -- nfiles = getdtablesize(); -- if (popen_pid == NULL) { -- popen_pid = (int *)malloc(nfiles * sizeof *popen_pid); -- if (popen_pid == NULL) -- return (NULL); -- for (pid = 0; pid < nfiles; pid++) -- popen_pid[pid] = -1; -- } -- if (pipe(p) < 0) -- return (NULL); -- myside = tst(p[WTR], p[RDR]); -- hisside = tst(p[RDR], p[WTR]); -- if ((pid = vfork()) == 0) { -- /* myside and hisside reverse roles in child */ -- close(myside); -- if (hisside != tst(0, 1)) { -- dup2(hisside, tst(0, 1)); -- close(hisside); -- } -- execl("/bin/sh", "sh", "-c", cmd, (char *)NULL); -- _exit(127); -- } -- if (pid == -1) { -- close(myside); -- close(hisside); -- return (NULL); -- } -- popen_pid[myside] = pid; -- close(hisside); -- return (fdopen(myside, mode)); --} -- --pclose(ptr) -- FILE *ptr; --{ -- int child, pid, status, omask; -- -- child = popen_pid[fileno(ptr)]; -- popen_pid[fileno(ptr)] = -1; -- fclose(ptr); -- if (child == -1) -- return (-1); -- omask = sigblock(sigmask(SIGINT)|sigmask(SIGQUIT)|sigmask(SIGHUP)); -- while ((pid = wait(&status)) != child && pid != -1) -- ; -- (void) sigsetmask(omask); -- return (pid == -1 ? -1 : status); --} -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/gen/qsort.c libx_c/gen/qsort.c ---- libx_c.pre/gen/qsort.c 2017-01-23 12:53:13.683903829 +1100 -+++ libx_c/gen/qsort.c 2017-01-23 12:53:13.687903838 +1100 -@@ -32,12 +32,14 @@ - * It's not... - */ - --qsort(base, n, size, compar) -- char *base; -+void -+qsort(_base, n, size, compar) -+ void *_base; - int n; - int size; - int (*compar)(); - { -+#define base ((char *)_base) - register char c, *i, *j, *lo, *hi; - char *min, *max; - -@@ -90,6 +92,7 @@ - } - } - } -+#undef base - } - - /* -@@ -107,10 +110,9 @@ - * (And there are only three places where this is done). - */ - --static -+static void - qst(base, max) -- char *base, *max; --{ -+ char *base, *max; { - register char c, *i, *j, *jj; - register int ii; - char *mid, *tmp; -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/gen/random.c libx_c/gen/random.c ---- libx_c.pre/gen/random.c 2017-01-23 12:53:13.679903821 +1100 -+++ libx_c/gen/random.c 2017-01-23 12:53:13.687903838 +1100 -@@ -224,7 +224,7 @@ - if( n < BREAK_1 ) { - if( n < BREAK_0 ) { - fprintf( stderr, "initstate: not enough state (%d bytes) with which to do jack; ignored.\n" ); -- return; -+ return( ostate ); - } - rand_type = TYPE_0; - rand_deg = DEG_0; -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/gen/regex.c libx_c/gen/regex.c ---- libx_c.pre/gen/regex.c 2017-01-23 12:53:13.683903829 +1100 -+++ libx_c/gen/regex.c 2017-01-23 12:53:13.687903838 +1100 -@@ -8,8 +8,6 @@ - static char sccsid[] = "@(#)regex.c 5.2 (Berkeley) 3/9/86"; - #endif LIBC_SCCS and not lint - --# -- - /* - * routines to do regular expression matching - * -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/gen/remque.c libx_c/gen/remque.c ---- libx_c.pre/gen/remque.c 2017-01-23 12:53:13.679903821 +1100 -+++ libx_c/gen/remque.c 2017-01-23 12:53:13.687903838 +1100 -@@ -8,16 +8,19 @@ - static char sccsid[] = "@(#)remque.c 5.1 (Berkeley) 1/27/87"; - #endif LIBC_SCCS and not lint - -+#include -+ - /* - * remque -- vax remque instruction - * - * NOTE: this implementation is non-atomic!! - */ - --struct vaxque { /* queue format expected by VAX queue instructions */ -- struct vaxque *vq_next; -- struct vaxque *vq_prev; --}; -+/* moved this to gen.h as it's shared by caller and by remque.c */ -+/*struct vaxque {*/ /* queue format expected by VAX queue instructions */ -+/* struct vaxque *vq_next;*/ -+/* struct vaxque *vq_prev;*/ -+/*};*/ - - remque(e) - register struct vaxque *e; -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/gen/signal.c libx_c/gen/signal.c ---- libx_c.pre/gen/signal.c 2017-01-23 12:53:13.679903821 +1100 -+++ libx_c/gen/signal.c 2017-01-23 12:53:13.687903838 +1100 -@@ -13,9 +13,10 @@ - */ - #include - --int (* --signal(s, a))() -- int s, (*a)(); -+void -+(*signal(s, a))() -+ int s; -+ void (*a)(); - { - struct sigvec osv, sv; - static int mask[NSIG]; -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/gen/sleep.c libx_c/gen/sleep.c ---- libx_c.pre/gen/sleep.c 2017-01-23 12:53:13.683903829 +1100 -+++ libx_c/gen/sleep.c 2017-01-23 12:53:13.687903838 +1100 -@@ -16,10 +16,12 @@ - - static int ringring; - -+void - sleep(n) - unsigned n; - { -- int sleepx(), omask; -+ void sleepx(); -+ int omask; - struct itimerval itv, oitv; - register struct itimerval *itp = &itv; - struct sigvec vec, ovec; -@@ -58,9 +60,8 @@ - (void) setitimer(ITIMER_REAL, &oitv, (struct itimerval *)0); - } - --static -+static void - sleepx() - { -- - ringring = 1; - } -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/gen/syslog.c libx_c/gen/syslog.c ---- libx_c.pre/gen/syslog.c 2017-01-23 12:53:13.679903821 +1100 -+++ libx_c/gen/syslog.c 2017-01-23 12:53:13.687903838 +1100 -@@ -32,6 +32,7 @@ - #include - #include - #include -+#include - - #define MAXLINE 1024 /* max message size */ - #define NULL 0 /* manifest */ -@@ -54,14 +55,17 @@ - extern int errno, sys_nerr; - extern char *sys_errlist[]; - --syslog(pri, fmt, p0, p1, p2, p3, p4) -+void -+syslog(pri, fmt, va_alist) - int pri; - char *fmt; -+ va_dcl - { - char buf[MAXLINE + 1], outline[MAXLINE + 1]; - register char *b, *f, *o; - register int c; - long now; -+ va_list argp; - int pid, olderrno = errno; - - /* see if we should just throw out this message */ -@@ -114,7 +118,9 @@ - } - *b++ = '\n'; - *b = '\0'; -- sprintf(o, buf, p0, p1, p2, p3, p4); -+ va_start(argp); -+ vsprintf(o, buf, argp); -+ va_end(argp); - c = strlen(outline); - if (c > MAXLINE) - c = MAXLINE; -@@ -152,6 +158,7 @@ - * OPENLOG -- open system log - */ - -+void - openlog(ident, logstat, logfac) - char *ident; - int logstat, logfac; -@@ -175,9 +182,9 @@ - * CLOSELOG -- close the system log - */ - -+void - closelog() - { -- - (void) close(LogFile); - LogFile = -1; - } -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/gen/system.c libx_c/gen/system.c ---- libx_c.pre/gen/system.c 2017-01-23 12:53:13.679903821 +1100 -+++ libx_c/gen/system.c 2017-01-23 12:53:13.687903838 +1100 -@@ -8,7 +8,7 @@ - char *s; - { - int status, pid, w; -- register int (*istat)(), (*qstat)(); -+ register void (*istat)(), (*qstat)(); - - if ((pid = vfork()) == 0) { - execl("/bin/sh", "sh", "-c", s, 0); -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/gen/usleep.c libx_c/gen/usleep.c ---- libx_c.pre/gen/usleep.c 2017-01-23 12:53:13.679903821 +1100 -+++ libx_c/gen/usleep.c 2017-01-23 12:53:13.687903838 +1100 -@@ -19,10 +19,12 @@ - - static int ringring; - -+void - usleep(n) - unsigned n; - { -- int sleepx(), omask; -+ void sleepx(); -+ int omask; - struct itimerval itv, oitv; - register struct itimerval *itp = &itv; - struct sigvec vec, ovec; -@@ -61,9 +63,7 @@ - (void) setitimer(ITIMER_REAL, &oitv, (struct itimerval *)0); - } - --static --sleepx() --{ -- -+static void -+sleepx() { - ringring = 1; - } -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/gen/valloc.c libx_c/gen/valloc.c ---- libx_c.pre/gen/valloc.c 2017-01-23 12:53:13.679903821 +1100 -+++ libx_c/gen/valloc.c 2017-01-23 12:53:13.687903838 +1100 -@@ -8,9 +8,9 @@ - static char sccsid[] = "@(#)valloc.c 5.2 (Berkeley) 3/9/86"; - #endif LIBC_SCCS and not lint - --char *malloc(); -+void *malloc(); - --char * -+void * - valloc(i) - int i; - { -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/gen.h libx_c/gen.h ---- libx_c.pre/gen.h 1970-01-01 10:00:00.000000000 +1000 -+++ libx_c/gen.h 2017-01-23 12:53:13.687903838 +1100 -@@ -0,0 +1,5 @@ -+/* formerly duplicated in gen/insque.c and gen/remque.c */ -+struct vaxque { /* queue format expected by VAX queue instructions */ -+ struct vaxque *vq_next; -+ struct vaxque *vq_prev; -+}; -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/inet/Makefile libx_c/inet/Makefile ---- libx_c.pre/inet/Makefile 2017-01-23 12:53:13.671903803 +1100 -+++ libx_c/inet/Makefile 2017-01-23 12:53:13.687903838 +1100 -@@ -58,14 +58,3 @@ - - # DO NOT DELETE THIS LINE -- make depend uses it - --inet_addr.o: inet_addr.c /usr/include/sys/types.h /usr/include/ctype.h --inet_addr.o: /usr/include/netinet/in.h --inet_network.o: inet_network.c /usr/include/sys/types.h /usr/include/ctype.h --inet_netof.o: inet_netof.c /usr/include/sys/types.h /usr/include/netinet/in.h --inet_ntoa.o: inet_ntoa.c /usr/include/sys/types.h /usr/include/netinet/in.h --inet_lnaof.o: inet_lnaof.c /usr/include/sys/types.h /usr/include/netinet/in.h --inet_makeaddr.o: inet_makeaddr.c /usr/include/sys/types.h --inet_makeaddr.o: /usr/include/netinet/in.h --# DEPENDENCIES MUST END AT END OF FILE --# IF YOU PUT STUFF HERE IT WILL GO AWAY --# see make depend above -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/net/hosttable/Makefile libx_c/net/hosttable/Makefile ---- libx_c.pre/net/hosttable/Makefile 2017-01-23 12:53:13.671903803 +1100 -+++ libx_c/net/hosttable/Makefile 2017-01-23 12:53:13.687903838 +1100 -@@ -54,11 +54,3 @@ - - # DO NOT DELETE THIS LINE -- make depend uses it - --gethostnamadr.o: gethostnamadr.c /usr/include/stdio.h /usr/include/netdb.h --gethostnamadr.o: /usr/include/sys/file.h /usr/include/ndbm.h --gethostent.o: gethostent.c /usr/include/stdio.h /usr/include/sys/types.h --gethostent.o: /usr/include/sys/socket.h /usr/include/netdb.h --gethostent.o: /usr/include/ctype.h /usr/include/ndbm.h --# DEPENDENCIES MUST END AT END OF FILE --# IF YOU PUT STUFF HERE IT WILL GO AWAY --# see make depend above -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/net/htonl.c libx_c/net/htonl.c ---- libx_c.pre/net/htonl.c 2017-01-23 12:53:13.671903803 +1100 -+++ libx_c/net/htonl.c 2017-01-23 12:56:36.556443012 +1100 -@@ -1,6 +1,5 @@ --#include --#include - #include -+#include - - u_long htonl(hostlong) u_long hostlong; { - write(2, "htonl()\n", 8); -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/net/htons.c libx_c/net/htons.c ---- libx_c.pre/net/htons.c 2017-01-23 12:53:13.671903803 +1100 -+++ libx_c/net/htons.c 2017-01-23 12:56:40.332454535 +1100 -@@ -1,6 +1,5 @@ --#include --#include - #include -+#include - - u_short htons(hostshort) u_short hostshort; { - write(2, "htons()\n", 8); -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/net/Makefile libx_c/net/Makefile ---- libx_c.pre/net/Makefile 2017-01-23 12:53:13.671903803 +1100 -+++ libx_c/net/Makefile 2017-01-23 12:53:13.687903838 +1100 -@@ -63,54 +63,3 @@ - - # DO NOT DELETE THIS LINE -- make depend uses it - --getnetbyaddr.o: getnetbyaddr.c /usr/include/netdb.h --getnetent.o: getnetent.c /usr/include/stdio.h /usr/include/sys/types.h --getnetent.o: /usr/include/sys/socket.h /usr/include/netdb.h --getnetent.o: /usr/include/ctype.h --getnetbyname.o: getnetbyname.c /usr/include/netdb.h --getproto.o: getproto.c /usr/include/netdb.h --getnetbyaddr.o: getnetbyaddr.c /usr/include/netdb.h --getnetent.o: getnetent.c /usr/include/stdio.h /usr/include/sys/types.h --getnetent.o: /usr/include/sys/socket.h /usr/include/netdb.h --getnetent.o: /usr/include/ctype.h --getnetbyname.o: getnetbyname.c /usr/include/netdb.h --getproto.o: getproto.c /usr/include/netdb.h --getprotoent.o: getprotoent.c /usr/include/stdio.h /usr/include/sys/types.h --getprotoent.o: /usr/include/sys/socket.h /usr/include/netdb.h --getprotoent.o: /usr/include/ctype.h --getprotoname.o: getprotoname.c /usr/include/netdb.h --getservent.o: getservent.c /usr/include/stdio.h /usr/include/sys/types.h --getservent.o: /usr/include/sys/socket.h /usr/include/netdb.h --getservent.o: /usr/include/ctype.h --getservbyport.o: getservbyport.c /usr/include/netdb.h --getservbyname.o: getservbyname.c /usr/include/netdb.h --rcmd.o: rcmd.c /usr/include/stdio.h /usr/include/ctype.h /usr/include/pwd.h --rcmd.o: /usr/include/sys/param.h /usr/include/machine/machparam.h --rcmd.o: /usr/include/signal.h /usr/include/sys/types.h --rcmd.o: /usr/include/sys/socket.h /usr/include/sys/stat.h --rcmd.o: /usr/include/netinet/in.h /usr/include/netdb.h /usr/include/errno.h --rexec.o: rexec.c /usr/include/sys/types.h /usr/include/sys/socket.h --rexec.o: /usr/include/netinet/in.h /usr/include/stdio.h /usr/include/netdb.h --rexec.o: /usr/include/errno.h --ruserpass.o: ruserpass.c /usr/include/stdio.h /usr/include/utmp.h --ruserpass.o: /usr/include/ctype.h /usr/include/sys/types.h --ruserpass.o: /usr/include/sys/stat.h /usr/include/errno.h --res_comp.o: res_comp.c /usr/include/sys/types.h /usr/include/stdio.h --res_comp.o: /usr/include/arpa/nameser.h --res_debug.o: res_debug.c /usr/include/sys/types.h /usr/include/netinet/in.h --res_debug.o: /usr/include/stdio.h /usr/include/arpa/nameser.h --res_init.o: res_init.c /usr/include/sys/types.h /usr/include/sys/socket.h --res_init.o: /usr/include/netinet/in.h /usr/include/stdio.h --res_init.o: /usr/include/arpa/nameser.h /usr/include/resolv.h --res_mkquery.o: res_mkquery.c /usr/include/stdio.h /usr/include/sys/types.h --res_mkquery.o: /usr/include/netinet/in.h /usr/include/arpa/nameser.h --res_mkquery.o: /usr/include/resolv.h --res_send.o: res_send.c /usr/include/sys/param.h --res_send.o: /usr/include/machine/machparam.h /usr/include/signal.h --res_send.o: /usr/include/sys/types.h /usr/include/sys/time.h --res_send.o: /usr/include/time.h /usr/include/sys/socket.h --res_send.o: /usr/include/netinet/in.h /usr/include/stdio.h /usr/include/errno.h --res_send.o: /usr/include/arpa/nameser.h /usr/include/resolv.h --# DEPENDENCIES MUST END AT END OF FILE --# IF YOU PUT STUFF HERE IT WILL GO AWAY --# see make depend above -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/net/named/Makefile libx_c/net/named/Makefile ---- libx_c.pre/net/named/Makefile 2017-01-23 12:53:13.671903803 +1100 -+++ libx_c/net/named/Makefile 2017-01-23 12:53:13.687903838 +1100 -@@ -57,14 +57,3 @@ - - # DO NOT DELETE THIS LINE -- make depend uses it - --gethostnamadr.o: gethostnamadr.c /usr/include/sys/param.h --gethostnamadr.o: /usr/include/machine/machparam.h /usr/include/signal.h --gethostnamadr.o: /usr/include/sys/types.h /usr/include/sys/socket.h --gethostnamadr.o: /usr/include/netinet/in.h /usr/include/sys/types.h --gethostnamadr.o: /usr/include/ctype.h /usr/include/netdb.h /usr/include/stdio.h --gethostnamadr.o: /usr/include/errno.h /usr/include/arpa/nameser.h --gethostnamadr.o: /usr/include/resolv.h --sethostent.o: sethostent.c --# DEPENDENCIES MUST END AT END OF FILE --# IF YOU PUT STUFF HERE IT WILL GO AWAY --# see make depend above -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/net/ntohl.c libx_c/net/ntohl.c ---- libx_c.pre/net/ntohl.c 2017-01-23 12:53:13.671903803 +1100 -+++ libx_c/net/ntohl.c 2017-01-23 12:56:44.616467665 +1100 -@@ -1,6 +1,5 @@ --#include --#include - #include -+#include - - u_long ntohl(netlong) u_long netlong; { - write(2, "ntohl()\n", 8); -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/net/ntohs.c libx_c/net/ntohs.c ---- libx_c.pre/net/ntohs.c 2017-01-23 12:53:13.671903803 +1100 -+++ libx_c/net/ntohs.c 2017-01-23 12:56:48.096478376 +1100 -@@ -1,6 +1,5 @@ --#include --#include - #include -+#include - - u_short ntohs(netshort) u_short netshort; { - write(2, "ntohs()\n", 8); -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/net/rcmd.c libx_c/net/rcmd.c ---- libx_c.pre/net/rcmd.c 2017-01-23 12:53:13.671903803 +1100 -+++ libx_c/net/rcmd.c 2017-01-23 12:53:13.687903838 +1100 -@@ -59,7 +59,7 @@ - sin.sin_family = hp->h_addrtype; - bcopy(hp->h_addr_list[0], (caddr_t)&sin.sin_addr, hp->h_length); - sin.sin_port = rport; -- if (connect(s, (caddr_t)&sin, sizeof (sin), 0) >= 0) -+ if (connect(s, (struct sockaddr *)&sin, sizeof (sin)/*, 0*/) >= 0) - break; - (void) close(s); - if (errno == EADDRINUSE) { -@@ -107,7 +107,7 @@ - (void) close(s2); - goto bad; - } -- s3 = accept(s2, &from, &len, 0); -+ s3 = accept(s2, (struct sockaddr *)&from, &len/*, 0*/); - (void) close(s2); - if (s3 < 0) { - perror("accept"); -@@ -162,7 +162,7 @@ - return (-1); - for (;;) { - sin.sin_port = htons((u_short)*alport); -- if (bind(s, (caddr_t)&sin, sizeof (sin)) >= 0) -+ if (bind(s, (struct sockaddr *)&sin, sizeof (sin)) >= 0) - return (s); - if (errno != EADDRINUSE) { - (void) close(s); -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/net/res_debug.c libx_c/net/res_debug.c ---- libx_c.pre/net/res_debug.c 2017-01-23 12:53:13.671903803 +1100 -+++ libx_c/net/res_debug.c 2017-01-23 12:53:13.687903838 +1100 -@@ -328,7 +328,9 @@ - } - - static char nbuf[20]; --extern char *sprintf(); -+/* we have taken the portable sprintf() from 4.3tahoe */ -+/*extern char *sprintf();*/ -+extern int sprintf(); - - /* - * Return a string for the type -@@ -385,7 +387,10 @@ - case T_GID: - return("GID"); - default: -- return (sprintf(nbuf, "%d", type)); -+/* we have taken the portable sprintf() from 4.3tahoe */ -+ /*return (sprintf(nbuf, "%d", type));*/ -+ sprintf(nbuf, "%d", type); -+ return nbuf; - } - } - -@@ -403,6 +408,9 @@ - case C_ANY: /* matches any class */ - return("ANY"); - default: -- return (sprintf(nbuf, "%d", class)); -+/* we have taken the portable sprintf() from 4.3tahoe */ -+ /*return (sprintf(nbuf, "%d", class));*/ -+ sprintf(nbuf, "%d", class); -+ return nbuf; - } - } -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/net/res_mkquery.c libx_c/net/res_mkquery.c ---- libx_c.pre/net/res_mkquery.c 2017-01-23 12:53:13.671903803 +1100 -+++ libx_c/net/res_mkquery.c 2017-01-23 12:53:13.687903838 +1100 -@@ -14,7 +14,10 @@ - #include - #include - --extern char *sprintf(); -+/* we have taken the portable sprintf() from 4.3tahoe */ -+/*extern char *sprintf();*/ -+extern int sprintf(); -+ - - /* - * Form all types of queries. -@@ -71,7 +74,9 @@ - if (res_init() == -1) - return(-1); - if (_res.defdname[0] != '\0') -- dname = sprintf(dnbuf, "%s.%s", dname, _res.defdname); -+/* we have taken the portable sprintf() from 4.3tahoe */ -+ /*dname = sprintf(dnbuf, "%s.%s", dname, _res.defdname);*/ -+ sprintf(dname = dnbuf, "%s.%s", dname, _res.defdname); - } - /* - * perform opcode specific processing -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/net/res_send.c libx_c/net/res_send.c ---- libx_c.pre/net/res_send.c 2017-01-23 12:53:13.671903803 +1100 -+++ libx_c/net/res_send.c 2017-01-23 12:53:13.687903838 +1100 -@@ -83,7 +83,7 @@ - #endif DEBUG - continue; - } -- if (connect(s, &(_res.nsaddr_list[ns]), -+ if (connect(s, (struct sockaddr *)&(_res.nsaddr_list[ns]), - sizeof(struct sockaddr)) < 0) { - terrno = errno; - #ifdef DEBUG -@@ -157,7 +157,7 @@ - if (s < 0) - s = socket(AF_INET, SOCK_DGRAM, 0); - #if BSD >= 43 -- if (connect(s, &_res.nsaddr_list[ns], -+ if (connect(s, (struct sockaddr *)&_res.nsaddr_list[ns], - sizeof(struct sockaddr)) < 0 || - send(s, buf, buflen, 0) != buflen) { - #ifdef DEBUG -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/net/rexec.c libx_c/net/rexec.c ---- libx_c.pre/net/rexec.c 2017-01-23 12:53:13.671903803 +1100 -+++ libx_c/net/rexec.c 2017-01-23 12:53:13.687903838 +1100 -@@ -50,7 +50,7 @@ - sin.sin_family = hp->h_addrtype; - sin.sin_port = rport; - bcopy(hp->h_addr, (caddr_t)&sin.sin_addr, hp->h_length); -- if (connect(s, &sin, sizeof(sin)) < 0) { -+ if (connect(s, (struct sockaddr *)&sin, sizeof(sin)) < 0) { - if (errno == ECONNREFUSED && timo <= 16) { - (void) close(s); - sleep(timo); -@@ -84,7 +84,7 @@ - (void) sprintf(num, "%d", port); - (void) write(s, num, strlen(num)+1); - { int len = sizeof (from); -- s3 = accept(s2, &from, &len, 0); -+ s3 = accept(s2, (struct sockaddr *)&from, &len/*, 0*/); - close(s2); - if (s3 < 0) { - perror("accept"); -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/net/ruserpass.c libx_c/net/ruserpass.c ---- libx_c.pre/net/ruserpass.c 2017-01-23 12:53:13.671903803 +1100 -+++ libx_c/net/ruserpass.c 2017-01-23 12:53:13.687903838 +1100 -@@ -19,6 +19,7 @@ - struct utmp *getutmp(); - static FILE *cfile; - -+void - ruserpass(host, aname, apass) - char *host, **aname, **apass; - { -@@ -46,7 +47,7 @@ - } - } - --static -+static void - renv(host, aname, apass) - char *host, **aname, **apass; - { -@@ -74,8 +75,7 @@ - mkpwclear(cp, host[0], *apass); - } - --static --char * -+static char * - renvlook(host) - char *host; - { -@@ -128,7 +128,7 @@ - 0, 0 - }; - --static -+static void - rnetrc(host, aname, apass) - char *host, **aname, **apass; - { -@@ -487,7 +487,7 @@ - * Set up the key schedule from the key. - */ - --static -+static void - nbssetkey(key) - char *key; - { -@@ -612,7 +612,7 @@ - * The payoff: encrypt a block. - */ - --static -+static void - blkencrypt(block, edflag) - char *block; - { -@@ -728,7 +728,7 @@ - return(NULL); - } - --static -+static void - sreverse(sto, sfrom) - register char *sto, *sfrom; - { -@@ -773,6 +773,7 @@ - return (skey); - } - -+void - mkpwunclear(spasswd,mch,sencpasswd) - char mch, *spasswd, *sencpasswd; - { -@@ -790,6 +791,7 @@ - nbsencrypt(spasswd, skey, sencpasswd); - } - -+void - mkpwclear(sencpasswd,mch,spasswd) - char mch, *spasswd, *sencpasswd; - { -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/net.h libx_c/net.h ---- libx_c.pre/net.h 1970-01-01 10:00:00.000000000 +1000 -+++ libx_c/net.h 2017-01-23 12:54:33.804096434 +1100 -@@ -0,0 +1,6 @@ -+/* -+ * Functions for number representation conversion. -+ */ -+/* formerly duplicated in netinet/in.h and netns/ns.h */ -+u_short ntohs(), htons(); -+u_long ntohl(), htonl(); -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/netinet/in.h libx_c/netinet/in.h ---- libx_c.pre/netinet/in.h 2017-01-23 12:53:13.679903821 +1100 -+++ libx_c/netinet/in.h 2017-01-23 12:53:13.687903838 +1100 -@@ -90,20 +90,11 @@ - */ - #define IP_OPTIONS 1 /* set/get IP per-packet options */ - --#if !defined(vax) && !defined(ntohl) && !defined(lint) - /* -- * Macros for number representation conversion. -+ * Functions for number representation conversion. - */ --#define ntohl(x) (x) --#define ntohs(x) (x) --#define htonl(x) (x) --#define htons(x) (x) --#endif -- --#if !defined(ntohl) && (defined(vax) || defined(lint)) - u_short ntohs(), htons(); - u_long ntohl(), htonl(); --#endif - - #ifdef KERNEL - extern struct domain inetdomain; -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/netinet/ip.h libx_c/netinet/ip.h ---- libx_c.pre/netinet/ip.h 2017-01-23 12:53:13.679903821 +1100 -+++ libx_c/netinet/ip.h 2017-01-23 12:53:13.687903838 +1100 -@@ -81,7 +81,7 @@ - struct in_addr ipt_addr; - n_long ipt_time; - } ipt_ta[1]; -- } -+ }; - }; - - /* flag bits for ipt_flg */ -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/netinet/tcp.h libx_c/netinet/tcp.h ---- libx_c.pre/netinet/tcp.h 2017-01-23 12:53:13.679903821 +1100 -+++ libx_c/netinet/tcp.h 2017-01-23 12:53:13.687903838 +1100 -@@ -44,7 +44,9 @@ - #ifdef lint - #define TCP_MSS 536 - #else --#define TCP_MSS MIN(512, IP_MSS - sizeof (struct tcpiphdr)) -+/* redefined this to avoid a circular dependency */ -+/*#define TCP_MSS MIN(512, IP_MSS - sizeof (struct tcpiphdr))*/ -+#define TCP_MSS MIN(512, IP_MSS - sizeof(struct ipovly) - sizeof(struct tcphdr)) - #endif - - /* -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/netns/ns.h libx_c/netns/ns.h ---- libx_c.pre/netns/ns.h 2017-01-23 12:53:13.679903821 +1100 -+++ libx_c/netns/ns.h 2017-01-23 12:53:13.687903838 +1100 -@@ -103,20 +103,11 @@ - #define ns_nullhost(x) (((x).x_host.s_host[0]==0) && \ - ((x).x_host.s_host[1]==0) && ((x).x_host.s_host[2]==0)) - --#if !defined(vax) && !defined(ntohl) && !defined(lint) - /* -- * Macros for number representation conversion. -+ * Functions for number representation conversion. - */ --#define ntohl(x) (x) --#define ntohs(x) (x) --#define htonl(x) (x) --#define htons(x) (x) --#endif -- --#if !defined(ntohl) && (defined(vax) || defined(lint)) - u_short ntohs(), htons(); - u_long ntohl(), htonl(); --#endif - - #ifdef KERNEL - extern struct domain nsdomain; -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/nlist.h libx_c/nlist.h ---- libx_c.pre/nlist.h 2017-01-23 12:53:13.671903803 +1100 -+++ libx_c/nlist.h 1970-01-01 10:00:00.000000000 +1000 -@@ -1,46 +0,0 @@ --/* -- * Copyright (c) 1980 Regents of the University of California. -- * All rights reserved. The Berkeley software License Agreement -- * specifies the terms and conditions for redistribution. -- * -- * @(#)nlist.h 5.1 (Berkeley) 5/30/85 -- */ -- --/* -- * Format of a symbol table entry; this file is included by -- * and should be used if you aren't interested the a.out header -- * or relocation information. -- */ --struct nlist { -- char *n_name; /* for use when in-core */ -- unsigned char n_type; /* type flag, i.e. N_TEXT etc; see below */ -- char n_other; /* unused */ -- short n_desc; /* see */ -- unsigned long n_value; /* value of this symbol (or sdb offset) */ --}; --#define n_hash n_desc /* used internally by ld */ -- --/* -- * Simple values for n_type. -- */ --#define N_UNDF 0x0 /* undefined */ --#define N_ABS 0x2 /* absolute */ --#define N_TEXT 0x4 /* text */ --#define N_DATA 0x6 /* data */ --#define N_BSS 0x8 /* bss */ --#define N_COMM 0x12 /* common (internal to ld) */ --#define N_FN 0x1f /* file name symbol */ -- --#define N_EXT 01 /* external bit, or'ed in */ --#define N_TYPE 0x1e /* mask for all the type bits */ -- --/* -- * Sdb entries have some of the N_STAB bits set. -- * These are given in -- */ --#define N_STAB 0xe0 /* if any of these bits set, a SDB entry */ -- --/* -- * Format for namelist values. -- */ --#define N_FORMAT "%08x" -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/ns/Makefile libx_c/ns/Makefile ---- libx_c.pre/ns/Makefile 2017-01-23 12:53:13.671903803 +1100 -+++ libx_c/ns/Makefile 2017-01-23 12:53:13.691903847 +1100 -@@ -54,8 +54,3 @@ - - # DO NOT DELETE THIS LINE -- make depend uses it - --ns_addr.o: ns_addr.c /usr/include/sys/types.h /usr/include/netns/ns.h --ns_ntoa.o: ns_ntoa.c /usr/include/sys/types.h /usr/include/netns/ns.h --# DEPENDENCIES MUST END AT END OF FILE --# IF YOU PUT STUFF HERE IT WILL GO AWAY --# see make depend above -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/ns/ns_addr.c libx_c/ns/ns_addr.c ---- libx_c.pre/ns/ns_addr.c 2017-01-23 12:53:13.671903803 +1100 -+++ libx_c/ns/ns_addr.c 2017-01-23 12:53:13.691903847 +1100 -@@ -55,7 +55,7 @@ - socketname = index(hostname, separator); - if (socketname) { - *socketname++ = 0; -- Field(socketname, &addr.x_port, 2); -+ Field(socketname, (char *)&addr.x_port, 2); - } - - Field(hostname, addr.x_host.c_host, 6); -@@ -63,7 +63,7 @@ - return (addr); - } - --static -+static void - Field(buf, out, len) - char *buf; - u_char *out; -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/stdio/doprnt.c libx_c/stdio/doprnt.c ---- libx_c.pre/stdio/doprnt.c 2017-01-23 12:53:13.671903803 +1100 -+++ libx_c/stdio/doprnt.c 2017-01-23 12:53:13.691903847 +1100 -@@ -272,9 +272,10 @@ - * NUL in the first `prec' characters, and - * strlen() will go further. - */ -- char *p, *memchr(); -+ char *p; -+ void *memchr(); - -- if (p = memchr(t, 0, prec)) { -+ if (p = (char *)memchr(t, 0, prec)) { - size = p - t; - if (size > prec) - size = prec; -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/stdio/doscan.c libx_c/stdio/doscan.c ---- libx_c.pre/stdio/doscan.c 2017-01-23 12:53:13.671903803 +1100 -+++ libx_c/stdio/doscan.c 2017-01-23 12:53:13.691903847 +1100 -@@ -3,7 +3,8 @@ - #endif LIBC_SCCS and not lint - - #include --#include -+#include -+#include - - #define SPC 01 - #define STP 02 -@@ -30,11 +31,11 @@ - _doscan(iop, fmt, argp) - FILE *iop; - register char *fmt; --register int **argp; -+register va_list argp; - { - register int ch; - int nmatch, len, ch1; -- int **ptr, fileended, size; -+ int *ptr, fileended, size; - - nmatch = 0; - fileended = 0; -@@ -46,7 +47,7 @@ - goto def; - ptr = 0; - if (ch != '*') -- ptr = argp++; -+ ptr = va_arg(argp, int *); - else - ch = *fmt++; - len = 0; -@@ -100,7 +101,7 @@ - - static - _innum(ptr, type, len, size, iop, eofptr) --int **ptr, *eofptr; -+int *ptr, *eofptr; - FILE *iop; - { - extern double atof(); -@@ -111,7 +112,7 @@ - long lcval; - - if (type=='c' || type=='s' || type=='[') -- return(_instr(ptr? *(char **)ptr: (char *)NULL, type, len, iop, eofptr)); -+ return(_instr(ptr? (char *)ptr: (char *)NULL, type, len, iop, eofptr)); - lcval = 0; - ndigit = 0; - scale = INT; -@@ -185,23 +186,23 @@ - - case (FLOAT<<4) | SHORT: - case (FLOAT<<4) | REGULAR: -- **(float **)ptr = atof(numbuf); -+ *(float *)ptr = atof(numbuf); - break; - - case (FLOAT<<4) | LONG: -- **(double **)ptr = atof(numbuf); -+ *(double *)ptr = atof(numbuf); - break; - - case (INT<<4) | SHORT: -- **(short **)ptr = lcval; -+ *(short *)ptr = lcval; - break; - - case (INT<<4) | REGULAR: -- **(int **)ptr = lcval; -+ *(int *)ptr = lcval; - break; - - case (INT<<4) | LONG: -- **(long **)ptr = lcval; -+ *(long *)ptr = lcval; - break; - } - return(1); -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/stdio/findiop.c libx_c/stdio/findiop.c ---- libx_c.pre/stdio/findiop.c 2017-01-23 12:53:13.671903803 +1100 -+++ libx_c/stdio/findiop.c 2017-01-23 12:53:13.691903847 +1100 -@@ -23,7 +23,7 @@ - { 0, NULL, NULL, 0, _IOWRT|_IONBF, 2 }, /* stderr */ - }; - --extern char *calloc(); -+extern void *calloc(); - - static char sbuf[NSTATIC]; - char *_smallbuf = sbuf; -@@ -87,10 +87,11 @@ - for (fp = _iob, iov = iobglue; fp < &_iob[NSTATIC]; /* void */) - *iov++ = fp++; - -- _smallbuf = calloc(nfiles, sizeof(*_smallbuf)); -+ _smallbuf = (char *)calloc(nfiles, sizeof(*_smallbuf)); - return (1); - } - -+void - f_prealloc() - { - register FILE **iov; -@@ -104,6 +105,7 @@ - *iov = (FILE *)calloc(1, sizeof **iov); - } - -+void - _fwalk(function) - register int (*function)(); - { -@@ -121,6 +123,7 @@ - } - } - -+void - _cleanup() - { - extern int fclose(); -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/stdio/fprintf.c libx_c/stdio/fprintf.c ---- libx_c.pre/stdio/fprintf.c 2017-01-23 12:53:13.671903803 +1100 -+++ libx_c/stdio/fprintf.c 2017-01-23 12:53:13.691903847 +1100 -@@ -1,32 +1,49 @@ - /* - * Copyright (c) 1980 Regents of the University of California. -- * All rights reserved. The Berkeley software License Agreement -- * specifies the terms and conditions for redistribution. -+ * All rights reserved. -+ * -+ * Redistribution and use in source and binary forms are permitted -+ * provided that the above copyright notice and this paragraph are -+ * duplicated in all such forms and that any documentation, -+ * advertising materials, and other materials related to such -+ * distribution and use acknowledge that the software was developed -+ * by the University of California, Berkeley. The name of the -+ * University may not be used to endorse or promote products derived -+ * from this software without specific prior written permission. -+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -+ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - - #if defined(LIBC_SCCS) && !defined(lint) --static char sccsid[] = "@(#)fprintf.c 5.2 (Berkeley) 3/9/86"; -+static char sccsid[] = "@(#)fprintf.c 5.4 (Berkeley) 6/27/88"; - #endif LIBC_SCCS and not lint - --#include -+#include -+#include - --fprintf(iop, fmt, args) --register FILE *iop; --char *fmt; -+fprintf(iop, fmt, va_alist) -+ register FILE *iop; -+ char *fmt; -+ va_dcl - { -+ va_list argp; -+ int len; - char localbuf[BUFSIZ]; - -+ va_start(argp); - if (iop->_flag & _IONBF) { - iop->_flag &= ~_IONBF; - iop->_ptr = iop->_base = localbuf; - iop->_bufsiz = BUFSIZ; -- _doprnt(fmt, &args, iop); -+ len = _doprnt(fmt, argp, iop); - fflush(iop); - iop->_flag |= _IONBF; - iop->_base = NULL; - iop->_bufsiz = NULL; - iop->_cnt = 0; - } else -- _doprnt(fmt, &args, iop); -- return(ferror(iop)? EOF: 0); -+ len = _doprnt(fmt, argp, iop); -+ va_end(argp); -+ return(ferror(iop) ? EOF : len); - } -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/stdio/fread.c libx_c/stdio/fread.c ---- libx_c.pre/stdio/fread.c 2017-01-23 12:53:13.671903803 +1100 -+++ libx_c/stdio/fread.c 2017-01-23 12:53:13.691903847 +1100 -@@ -10,11 +10,12 @@ - - #include - --fread(ptr, size, count, iop) -- register char *ptr; -+fread(_ptr, size, count, iop) -+ void *_ptr; - unsigned size, count; - register FILE *iop; - { -+#define ptr (*(char **)&_ptr) - register int s; - int c; - -@@ -43,4 +44,5 @@ - } - } - return (size != 0 ? count - ((s + size - 1) / size) : 0); -+#undef ptr - } -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/stdio/fwrite.c libx_c/stdio/fwrite.c ---- libx_c.pre/stdio/fwrite.c 2017-01-23 12:53:13.671903803 +1100 -+++ libx_c/stdio/fwrite.c 2017-01-23 12:53:13.691903847 +1100 -@@ -10,11 +10,12 @@ - - #include - --fwrite(ptr, size, count, iop) -- register char *ptr; -+fwrite(_ptr, size, count, iop) -+ void *_ptr; - unsigned size, count; - register FILE *iop; - { -+#define ptr (*(char **)&_ptr) - register int s; - - s = size * count; -@@ -46,4 +47,5 @@ - } - } - return (size != 0 ? count - ((s + size - 1) / size) : 0); -+#undef ptr - } -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/stdio/Makefile libx_c/stdio/Makefile ---- libx_c.pre/stdio/Makefile 2017-01-23 12:53:13.671903803 +1100 -+++ libx_c/stdio/Makefile 2017-01-23 12:53:13.691903847 +1100 -@@ -5,35 +5,19 @@ - # - # @(#)Makefile 5.4 (Berkeley) 9/5/85 - # --# Several routines have been rewritten in assembly language for the VAX. --# If you are not running on a VAX, you should use the original C sources --# which are included in this directory. Regretably we do not have a C --# version of doprnt(). --# --#ifndef vax --#SRCS= ${STDSRC} ${VAXSRC} --#OBJS= ${STDOBJ} ${VAXOBJ} --#else --SRCS= ${STDSRC} --OBJS= ${STDOBJ} --#endif not vax -- -+SRCS= clrerr.c doprnt.c doscan.c exit.c fdopen.c fgetc.c fgets.c filbuf.c \ -+ findiop.c flsbuf.c fopen.c fprintf.c fputc.c fputs.c fread.c \ -+ freopen.c fseek.c ftell.c fwrite.c getchar.c gets.c getw.c popen.c \ -+ printf.c putchar.c puts.c putw.c rew.c scanf.c setbuf.c setbuffer.c \ -+ sibuf.c sobuf.c sprintf.c strout.c ungetc.c vfprintf.c vprintf.c \ -+ vsprintf.c -+OBJS= clrerr.o doprnt.o doscan.o exit.o fdopen.o fgetc.o fgets.o filbuf.o \ -+ findiop.o flsbuf.o fopen.o fprintf.o fputc.o fputs.o fread.o \ -+ freopen.o fseek.o ftell.o fwrite.o getchar.o gets.o getw.o popen.o \ -+ printf.o putchar.o puts.o putw.o rew.o scanf.o setbuf.o setbuffer.o \ -+ sibuf.o sobuf.o sprintf.o strout.o ungetc.o vfprintf.o vprintf.o \ -+ vsprintf.o - CFLAGS= -O ${DEFS} -- --STDSRC= clrerr.c doscan.c \ -- exit.c fdopen.c fgetc.c filbuf.c findiop.c flsbuf.c fopen.c \ -- fprintf.c fputc.c fread.c freopen.c fseek.c ftell.c \ -- fwrite.c getchar.c getw.c printf.c putchar.c \ -- putw.c rew.c scanf.c setbuf.c setbuffer.c sibuf.c sobuf.c \ -- sprintf.c strout.c ungetc.c --VAXSRC= fgets.c fputs.c gets.c puts.c --STDOBJ= clrerr.o doscan.o \ -- exit.o fdopen.o fgetc.o filbuf.o findiop.o flsbuf.o fopen.o \ -- fprintf.o fputc.o fread.o freopen.o fseek.o ftell.o \ -- fwrite.o getchar.o getw.o printf.o putchar.o \ -- putw.o rew.o scanf.o setbuf.o setbuffer.o sibuf.o sobuf.o \ -- sprintf.o strout.o ungetc.o --VAXOBJ= fgets.o fputs.o gets.o puts.o - TAGSFILE=tags - - .c.o: -@@ -78,41 +62,3 @@ - - # DO NOT DELETE THIS LINE -- make depend uses it - --clrerr.o: clrerr.c /usr/include/stdio.h --doscan.o: doscan.c /usr/include/stdio.h /usr/include/ctype.h --exit.o: exit.c --fdopen.o: fdopen.c /usr/include/sys/types.h /usr/include/sys/file.h --fdopen.o: /usr/include/stdio.h --fgetc.o: fgetc.c /usr/include/stdio.h --filbuf.o: filbuf.c /usr/include/stdio.h /usr/include/sys/types.h --filbuf.o: /usr/include/sys/stat.h --findiop.o: findiop.c /usr/include/stdio.h --flsbuf.o: flsbuf.c /usr/include/stdio.h /usr/include/sys/types.h --flsbuf.o: /usr/include/sys/stat.h --fopen.o: fopen.c /usr/include/sys/types.h /usr/include/sys/file.h --fopen.o: /usr/include/stdio.h --fprintf.o: fprintf.c /usr/include/stdio.h --fputc.o: fputc.c /usr/include/stdio.h --fread.o: fread.c /usr/include/stdio.h --freopen.o: freopen.c /usr/include/sys/types.h /usr/include/sys/file.h --freopen.o: /usr/include/stdio.h --fseek.o: fseek.c /usr/include/stdio.h --ftell.o: ftell.c /usr/include/stdio.h --fwrite.o: fwrite.c /usr/include/stdio.h --getchar.o: getchar.c /usr/include/stdio.h --getw.o: getw.c /usr/include/stdio.h --printf.o: printf.c /usr/include/stdio.h --putchar.o: putchar.c /usr/include/stdio.h --putw.o: putw.c /usr/include/stdio.h --rew.o: rew.c /usr/include/stdio.h --scanf.o: scanf.c /usr/include/stdio.h --setbuf.o: setbuf.c /usr/include/stdio.h --setbuffer.o: setbuffer.c /usr/include/stdio.h --sibuf.o: sibuf.c /usr/include/stdio.h --sobuf.o: sobuf.c /usr/include/stdio.h --sprintf.o: sprintf.c /usr/include/stdio.h --strout.o: strout.c /usr/include/stdio.h --ungetc.o: ungetc.c /usr/include/stdio.h --# DEPENDENCIES MUST END AT END OF FILE --# IF YOU PUT STUFF HERE IT WILL GO AWAY --# see make depend above -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/stdio/popen.c libx_c/stdio/popen.c ---- libx_c.pre/stdio/popen.c 1970-01-01 10:00:00.000000000 +1000 -+++ libx_c/stdio/popen.c 2017-01-23 12:53:13.691903847 +1100 -@@ -0,0 +1,77 @@ -+/* -+ * Copyright (c) 1980 Regents of the University of California. -+ * All rights reserved. The Berkeley software License Agreement -+ * specifies the terms and conditions for redistribution. -+ */ -+ -+#if defined(LIBC_SCCS) && !defined(lint) -+static char sccsid[] = "@(#)popen.c 5.4 (Berkeley) 3/26/86"; -+#endif -+ -+#include -+#include -+ -+#define tst(a,b) (*mode == 'r'? (b) : (a)) -+#define RDR 0 -+#define WTR 1 -+ -+extern char *malloc(); -+ -+static int *popen_pid; -+static int nfiles; -+ -+FILE * -+popen(cmd,mode) -+ char *cmd; -+ char *mode; { -+ int p[2]; -+ int myside, hisside, pid; -+ -+ if (nfiles <= 0) -+ nfiles = getdtablesize(); -+ if (popen_pid == NULL) { -+ popen_pid = (int *)malloc(nfiles * sizeof *popen_pid); -+ if (popen_pid == NULL) -+ return (NULL); -+ for (pid = 0; pid < nfiles; pid++) -+ popen_pid[pid] = -1; -+ } -+ if (pipe(p) < 0) -+ return (NULL); -+ myside = tst(p[WTR], p[RDR]); -+ hisside = tst(p[RDR], p[WTR]); -+ if ((pid = vfork()) == 0) { -+ /* myside and hisside reverse roles in child */ -+ close(myside); -+ if (hisside != tst(0, 1)) { -+ dup2(hisside, tst(0, 1)); -+ close(hisside); -+ } -+ execl("/bin/sh", "sh", "-c", cmd, (char *)NULL); -+ _exit(127); -+ } -+ if (pid == -1) { -+ close(myside); -+ close(hisside); -+ return (NULL); -+ } -+ popen_pid[myside] = pid; -+ close(hisside); -+ return (fdopen(myside, mode)); -+} -+ -+pclose(ptr) -+ FILE *ptr; { -+ int child, pid, status, omask; -+ -+ child = popen_pid[fileno(ptr)]; -+ popen_pid[fileno(ptr)] = -1; -+ fclose(ptr); -+ if (child == -1) -+ return (-1); -+ omask = sigblock(sigmask(SIGINT)|sigmask(SIGQUIT)|sigmask(SIGHUP)); -+ while ((pid = wait(&status)) != child && pid != -1) -+ ; -+ (void) sigsetmask(omask); -+ return (pid == -1 ? -1 : status); -+} -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/stdio/printf.c libx_c/stdio/printf.c ---- libx_c.pre/stdio/printf.c 2017-01-23 12:53:13.671903803 +1100 -+++ libx_c/stdio/printf.c 2017-01-23 12:53:13.691903847 +1100 -@@ -1,12 +1,36 @@ -+/* -+ * Copyright (c) 1987 Regents of the University of California. -+ * All rights reserved. -+ * -+ * Redistribution and use in source and binary forms are permitted -+ * provided that the above copyright notice and this paragraph are -+ * duplicated in all such forms and that any documentation, -+ * advertising materials, and other materials related to such -+ * distribution and use acknowledge that the software was developed -+ * by the University of California, Berkeley. The name of the -+ * University may not be used to endorse or promote products derived -+ * from this software without specific prior written permission. -+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -+ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. -+ */ -+ - #if defined(LIBC_SCCS) && !defined(lint) --static char sccsid[] = "@(#)printf.c 5.2 (Berkeley) 3/9/86"; -+static char sccsid[] = "@(#)printf.c 5.4 (Berkeley) 6/27/88"; - #endif LIBC_SCCS and not lint - --#include -+#include -+#include - --printf(fmt, args) --char *fmt; -+printf(fmt, va_alist) -+ char *fmt; -+ va_dcl - { -- _doprnt(fmt, &args, stdout); -- return(ferror(stdout)? EOF: 0); -+ va_list argp; -+ int len; -+ -+ va_start(argp); -+ len = _doprnt(fmt, argp, stdout); -+ va_end(argp); -+ return(ferror(stdout) ? EOF : len); - } -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/stdio/scanf.c libx_c/stdio/scanf.c ---- libx_c.pre/stdio/scanf.c 2017-01-23 12:53:13.671903803 +1100 -+++ libx_c/stdio/scanf.c 2017-01-23 12:53:13.691903847 +1100 -@@ -2,32 +2,53 @@ - static char sccsid[] = "@(#)scanf.c 5.2 (Berkeley) 3/9/86"; - #endif LIBC_SCCS and not lint - --#include -+#include -+#include - --scanf(fmt, args) -+scanf(fmt, va_alist) - char *fmt; -+va_dcl - { -- return(_doscan(stdin, fmt, &args)); -+ va_list argp; -+ int len; -+ -+ va_start(argp); -+ len = _doscan(stdin, fmt, argp); -+ va_end(argp); -+ return len; - } - --fscanf(iop, fmt, args) -+fscanf(iop, fmt, va_alist) - FILE *iop; - char *fmt; -+va_dcl - { -- return(_doscan(iop, fmt, &args)); -+ va_list argp; -+ int len; -+ -+ va_start(argp); -+ len = _doscan(iop, fmt, argp); -+ va_end(argp); -+ return len; - } - --sscanf(str, fmt, args) -+sscanf(str, fmt, va_alist) - register char *str; - char *fmt; -+va_dcl - { - FILE _strbuf; -+ va_list argp; -+ int len; - -+ va_start(argp); - _strbuf._flag = _IOREAD|_IOSTRG; - _strbuf._ptr = _strbuf._base = str; - _strbuf._cnt = 0; - while (*str++) - _strbuf._cnt++; - _strbuf._bufsiz = _strbuf._cnt; -- return(_doscan(&_strbuf, fmt, &args)); -+ len = _doscan(&_strbuf, fmt, argp); -+ va_end(argp); -+ return len; - } -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/stdio/setbuffer.c libx_c/stdio/setbuffer.c ---- libx_c.pre/stdio/setbuffer.c 2017-01-23 12:53:13.671903803 +1100 -+++ libx_c/stdio/setbuffer.c 2017-01-23 12:53:13.691903847 +1100 -@@ -35,11 +35,11 @@ - register FILE *iop; - { - char *buf; -- extern char *malloc(); -+ extern void *malloc(); - - fflush(iop); - setbuffer(iop, NULL, 0); -- buf = malloc(BUFSIZ); -+ buf = (char *)malloc(BUFSIZ); - if (buf != NULL) { - setbuffer(iop, buf, BUFSIZ); - iop->_flag |= _IOLBF|_IOMYBUF; -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/stdio/sprintf.c libx_c/stdio/sprintf.c ---- libx_c.pre/stdio/sprintf.c 2017-01-23 12:53:13.671903803 +1100 -+++ libx_c/stdio/sprintf.c 2017-01-23 12:53:13.691903847 +1100 -@@ -1,18 +1,41 @@ -+/* -+ * Copyright (c) 1987 Regents of the University of California. -+ * All rights reserved. -+ * -+ * Redistribution and use in source and binary forms are permitted -+ * provided that the above copyright notice and this paragraph are -+ * duplicated in all such forms and that any documentation, -+ * advertising materials, and other materials related to such -+ * distribution and use acknowledge that the software was developed -+ * by the University of California, Berkeley. The name of the -+ * University may not be used to endorse or promote products derived -+ * from this software without specific prior written permission. -+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -+ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. -+ */ -+ - #if defined(LIBC_SCCS) && !defined(lint) --static char sccsid[] = "@(#)sprintf.c 5.2 (Berkeley) 3/9/86"; -+static char sccsid[] = "@(#)sprintf.c 5.5 (Berkeley) 6/27/88"; - #endif LIBC_SCCS and not lint - --#include -+#include -+#include - --char *sprintf(str, fmt, args) --char *str, *fmt; -+sprintf(str, fmt, va_alist) -+ char *str, *fmt; -+ va_dcl - { -+ va_list argp; - FILE _strbuf; -+ int len; - -+ va_start(argp); - _strbuf._flag = _IOWRT+_IOSTRG; - _strbuf._ptr = str; - _strbuf._cnt = 32767; -- _doprnt(fmt, &args, &_strbuf); -- putc('\0', &_strbuf); -- return(str); -+ len = _doprnt(fmt, argp, &_strbuf); -+ *_strbuf._ptr = 0; -+ va_end(argp); -+ return(len); - } -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/stdio/vfprintf.c libx_c/stdio/vfprintf.c ---- libx_c.pre/stdio/vfprintf.c 1970-01-01 10:00:00.000000000 +1000 -+++ libx_c/stdio/vfprintf.c 2017-01-23 12:53:13.691903847 +1100 -@@ -0,0 +1,46 @@ -+/* -+ * Copyright (c) 1988 Regents of the University of California. -+ * All rights reserved. -+ * -+ * Redistribution and use in source and binary forms are permitted -+ * provided that the above copyright notice and this paragraph are -+ * duplicated in all such forms and that any documentation, -+ * advertising materials, and other materials related to such -+ * distribution and use acknowledge that the software was developed -+ * by the University of California, Berkeley. The name of the -+ * University may not be used to endorse or promote products derived -+ * from this software without specific prior written permission. -+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -+ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. -+ */ -+ -+#if defined(LIBC_SCCS) && !defined(lint) -+static char sccsid[] = "@(#)vfprintf.c 5.2 (Berkeley) 6/27/88"; -+#endif -+ -+#include -+#include -+ -+int -+vfprintf(iop, fmt, argp) -+ FILE *iop; -+ char *fmt; -+ va_list argp; { -+ int len; -+ char localbuf[BUFSIZ]; -+ -+ if (iop->_flag & _IONBF) { -+ iop->_flag &= ~_IONBF; -+ iop->_ptr = iop->_base = localbuf; -+ len = _doprnt(fmt, argp, iop); -+ (void) fflush(iop); -+ iop->_flag |= _IONBF; -+ iop->_base = NULL; -+ iop->_bufsiz = 0; -+ iop->_cnt = 0; -+ } else -+ len = _doprnt(fmt, argp, iop); -+ -+ return (ferror(iop) ? EOF : len); -+} -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/stdio/vprintf.c libx_c/stdio/vprintf.c ---- libx_c.pre/stdio/vprintf.c 1970-01-01 10:00:00.000000000 +1000 -+++ libx_c/stdio/vprintf.c 2017-01-23 12:53:13.691903847 +1100 -@@ -0,0 +1,33 @@ -+/* -+ * Copyright (c) 1988 Regents of the University of California. -+ * All rights reserved. -+ * -+ * Redistribution and use in source and binary forms are permitted -+ * provided that the above copyright notice and this paragraph are -+ * duplicated in all such forms and that any documentation, -+ * advertising materials, and other materials related to such -+ * distribution and use acknowledge that the software was developed -+ * by the University of California, Berkeley. The name of the -+ * University may not be used to endorse or promote products derived -+ * from this software without specific prior written permission. -+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -+ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. -+ */ -+ -+#if defined(LIBC_SCCS) && !defined(lint) -+static char sccsid[] = "@(#)vprintf.c 5.2 (Berkeley) 6/27/88"; -+#endif -+ -+#include -+#include -+ -+int -+vprintf(fmt, argp) -+ char *fmt; -+ va_list argp; { -+ int len; -+ -+ len = _doprnt(fmt, argp, stdout); -+ return (ferror(stdout) ? EOF : len); -+} -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/stdio/vsprintf.c libx_c/stdio/vsprintf.c ---- libx_c.pre/stdio/vsprintf.c 1970-01-01 10:00:00.000000000 +1000 -+++ libx_c/stdio/vsprintf.c 2017-01-23 12:53:13.691903847 +1100 -@@ -0,0 +1,38 @@ -+/* -+ * Copyright (c) 1988 Regents of the University of California. -+ * All rights reserved. -+ * -+ * Redistribution and use in source and binary forms are permitted -+ * provided that the above copyright notice and this paragraph are -+ * duplicated in all such forms and that any documentation, -+ * advertising materials, and other materials related to such -+ * distribution and use acknowledge that the software was developed -+ * by the University of California, Berkeley. The name of the -+ * University may not be used to endorse or promote products derived -+ * from this software without specific prior written permission. -+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -+ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. -+ */ -+ -+#if defined(LIBC_SCCS) && !defined(lint) -+static char sccsid[] = "@(#)vsprintf.c 5.2 (Berkeley) 6/27/88"; -+#endif -+ -+#include -+#include -+ -+int -+vsprintf(str, fmt, argp) -+ char *str, *fmt; -+ va_list argp; { -+ FILE f; -+ int len; -+ -+ f._flag = _IOWRT+_IOSTRG; -+ f._ptr = str; -+ f._cnt = 32767; -+ len = _doprnt(fmt, argp, &f); -+ *f._ptr = 0; -+ return (len); -+} -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/stdio.h libx_c/stdio.h ---- libx_c.pre/stdio.h 2017-01-23 12:53:13.667903794 +1100 -+++ libx_c/stdio.h 2017-01-23 12:53:13.691903847 +1100 -@@ -59,7 +59,7 @@ - long ftell(); - char *fgets(); - char *gets(); --#ifdef vax -+#if 0 /*def vax*/ - char *sprintf(); /* too painful to do right */ - #endif - # endif -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/sys/dir.h libx_c/sys/dir.h ---- libx_c.pre/sys/dir.h 2017-01-23 12:53:13.675903812 +1100 -+++ libx_c/sys/dir.h 2017-01-23 12:53:13.691903847 +1100 -@@ -32,9 +32,9 @@ - * dp->d_ino set to 0. - */ - /* so user programs can just include dir.h */ --#if !defined(KERNEL) && !defined(DEV_BSIZE) --#define DEV_BSIZE 512 --#endif -+/*#if !defined(KERNEL) && !defined(DEV_BSIZE)*/ -+/*#define DEV_BSIZE 512*/ -+/*#endif*/ - #define DIRBLKSIZ DEV_BSIZE - #define MAXNAMLEN 255 - -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/sys/errno.h libx_c/sys/errno.h ---- libx_c.pre/sys/errno.h 2017-01-23 12:53:13.675903812 +1100 -+++ libx_c/sys/errno.h 2017-01-23 12:53:13.691903847 +1100 -@@ -96,3 +96,7 @@ - #define EPROCLIM 67 /* Too many processes */ - #define EUSERS 68 /* Too many users */ - #define EDQUOT 69 /* Disc quota exceeded */ -+ -+#ifndef KERNEL -+extern int errno; -+#endif -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/sys/execl.c libx_c/sys/execl.c ---- libx_c.pre/sys/execl.c 2017-01-23 12:53:13.675903812 +1100 -+++ libx_c/sys/execl.c 2017-01-23 12:53:13.691903847 +1100 -@@ -1,4 +1,5 @@ --void execl(f, a) char *f, *a; { -+#include -+void execl(f, va_alist) char *f; va_dcl { - write(2, "execl()\n", 8); - abort(); - } -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/sys/execle.c libx_c/sys/execle.c ---- libx_c.pre/sys/execle.c 2017-01-23 12:53:13.671903803 +1100 -+++ libx_c/sys/execle.c 2017-01-23 12:53:13.691903847 +1100 -@@ -1,4 +1,5 @@ --void execle(f, a) char *f, *a; { -+#include -+void execle(f, va_alist) char *f; va_dcl { - write(2, "execle()\n", 9); - abort(); - } -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/sys/isatty.c libx_c/sys/isatty.c ---- libx_c.pre/sys/isatty.c 1970-01-01 10:00:00.000000000 +1000 -+++ libx_c/sys/isatty.c 2017-01-23 12:53:13.691903847 +1100 -@@ -0,0 +1,17 @@ -+#if defined(LIBC_SCCS) && !defined(lint) -+static char sccsid[] = "@(#)isatty.c 5.2 (Berkeley) 3/9/86"; -+#endif -+ -+/* -+ * Returns 1 iff file is a tty -+ */ -+ -+#include -+ -+isatty(f) { -+ struct sgttyb ttyb; -+ -+ if (ioctl(f, TIOCGETP, &ttyb) < 0) -+ return(0); -+ return(1); -+} -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/sys/Makefile libx_c/sys/Makefile ---- libx_c.pre/sys/Makefile 1970-01-01 10:00:00.000000000 +1000 -+++ libx_c/sys/Makefile 2017-01-23 12:53:13.691903847 +1100 -@@ -0,0 +1,88 @@ -+# -+# Copyright (c) 1980 Regents of the University of California. -+# All rights reserved. The Berkeley software License Agreement -+# specifies the terms and conditions for redistribution. -+# -+# @(#)Makefile 6.1 (Berkeley) 1/29/86 -+# -+ -+SRCS= accept.c access.c acct.c adjtime.c bind.c brk.c chdir.c chmod.c \ -+ chown.c chroot.c close.c connect.c creat.c dup2.c dup.c execl.c \ -+ execle.c exect.c execv.c execve.c _exit.c fchmod.c fchown.c fcntl.c \ -+ flock.c fork.c fstat.c fsync.c ftruncate.c getdtablesize.c getegid.c \ -+ geteuid.c getgid.c getgroups.c gethostid.c gethostname.c getitimer.c \ -+ getpagesize.c getpeername.c getpgrp.c getpid.c getppid.c \ -+ getpriority.c getrlimit.c getrusage.c getsockname.c getsockopt.c \ -+ gettimeofday.c getuid.c ioctl.c isatty.c kill.c killpg.c link.c \ -+ listen.c lseek.c lstat.c mkdir.c mknod.c mount.c open.c pipe.c \ -+ profil.c ptrace.c quota.c read.c readlink.c readv.c reboot.c recv.c \ -+ recvfrom.c recvmsg.c rename.c rmdir.c sbrk.c select.c send.c \ -+ sendmsg.c sendto.c setgroups.c sethostid.c sethostname.c setitimer.c \ -+ setpgrp.c setpriority.c setquota.c setregid.c setreuid.c setrlimit.c \ -+ setsockopt.c settimeofday.c shutdown.c sigblock.c sigpause.c \ -+ sigreturn.c sigsetmask.c sigstack.c sigvec.c socket.c socketpair.c \ -+ stat.c swapon.c symlink.c sync.c truncate.c umask.c umount.c unlink.c \ -+ utimes.c vfork.c vhangup.c vopen.c wait3.c wait.c write.c writev.c -+OBJS= accept.o access.o acct.o adjtime.o bind.o brk.o chdir.o chmod.o \ -+ chown.o chroot.o close.o connect.o creat.o dup2.o dup.o execl.o \ -+ execle.o exect.o execv.o execve.o _exit.o fchmod.o fchown.o fcntl.o \ -+ flock.o fork.o fstat.o fsync.o ftruncate.o getdtablesize.o getegid.o \ -+ geteuid.o getgid.o getgroups.o gethostid.o gethostname.o getitimer.o \ -+ getpagesize.o getpeername.o getpgrp.o getpid.o getppid.o \ -+ getpriority.o getrlimit.o getrusage.o getsockname.o getsockopt.o \ -+ gettimeofday.o getuid.o ioctl.o isatty.o kill.o killpg.o link.o \ -+ listen.o lseek.o lstat.o mkdir.o mknod.o mount.o open.o pipe.o \ -+ profil.o ptrace.o quota.o read.o readlink.o readv.o reboot.o recv.o \ -+ recvfrom.o recvmsg.o rename.o rmdir.o sbrk.o select.o send.o \ -+ sendmsg.o sendto.o setgroups.o sethostid.o sethostname.o setitimer.o \ -+ setpgrp.o setpriority.o setquota.o setregid.o setreuid.o setrlimit.o \ -+ setsockopt.o settimeofday.o shutdown.o sigblock.o sigpause.o \ -+ sigreturn.o sigsetmask.o sigstack.o sigvec.o socket.o socketpair.o \ -+ stat.o swapon.o symlink.o sync.o truncate.o umask.o umount.o unlink.o \ -+ utimes.o vfork.o vhangup.o vopen.o wait3.o wait.o write.o writev.o -+CFLAGS= -O ${DEFS} -+TAGSFILE=tags -+ -+.c.o: -+ ${CC} -p -c ${CFLAGS} $*.c -+ -ld -X -r $*.o -+ mv a.out profiled/$*.o -+ ${CC} ${CFLAGS} -c $*.c -+ -ld -x -r $*.o -+ mv a.out $*.o -+ -+syslib syslib_p: ${OBJS} -+ @echo "building profiled syslib" -+ @cd profiled; ar cru ../syslib_p ${OBJS} -+ @echo "building normal syslib" -+ @ar cru syslib ${OBJS} -+ -+tags: -+ cwd=`pwd`; \ -+ for i in ${SRCS}; do \ -+ ctags -a -f ${TAGSFILE} $$cwd/$$i; \ -+ done -+ -+clean: -+ rm -f syslib syslib_p *.o profiled/*.o errs a.out core \ -+ tags Makefile.bak -+ -+depend: -+ for i in ${SRCS}; do \ -+ cc -M ${CFLAGS} $$i | awk ' { if ($$1 != prev) \ -+ { if (rec != "") print rec; rec = $$0; prev = $$1; } \ -+ else { if (length(rec $$2) > 78) { print rec; rec = $$0; } \ -+ else rec = rec " " $$2 } } \ -+ END { print rec } ' >> makedep; done -+ echo '/^# DO NOT DELETE THIS LINE/+2,$$d' >eddep -+ echo '$$r makedep' >>eddep -+ echo 'w' >>eddep -+ cp Makefile Makefile.bak -+ ed - Makefile < eddep -+ rm eddep makedep -+ echo '# DEPENDENCIES MUST END AT END OF FILE' >> Makefile -+ echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >> Makefile -+ echo '# see make depend above' >> Makefile -+ -+# DO NOT DELETE THIS LINE -- make depend uses it -+ -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/sys/open.c libx_c/sys/open.c ---- libx_c.pre/sys/open.c 2017-01-23 12:53:13.671903803 +1100 -+++ libx_c/sys/open.c 2017-01-23 12:53:13.691903847 +1100 -@@ -1,6 +1,11 @@ - #include - - int open(f, m, va_alist) char *f; va_dcl { -- write(2, "open()\n", 7); -- abort(); -+ va_list argp; -+ int res; -+ -+ va_start(argp); -+ res = vopen(f, m, argp); -+ va_end(argp); -+ return res; - } -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/sys/param.h libx_c/sys/param.h ---- libx_c.pre/sys/param.h 2017-01-23 12:53:13.675903812 +1100 -+++ libx_c/sys/param.h 2017-01-23 12:53:13.691903847 +1100 -@@ -53,15 +53,16 @@ - /* - * Signals - */ --#ifdef KERNEL --#include "signal.h" --#else --#include --#endif -- --#define ISSIG(p) \ -- ((p)->p_sig && ((p)->p_flag&STRC || \ -- ((p)->p_sig &~ ((p)->p_sigignore | (p)->p_sigmask))) && issig()) -+/*#ifdef KERNEL*/ -+/*#include "signal.h"*/ -+/*#else*/ -+/*#include */ -+/*#endif*/ -+ -+/* moved this to sys/proc.h to avoid a circular dependency */ -+/*#define ISSIG(p) \*/ -+/* ((p)->p_sig && ((p)->p_flag&STRC || \*/ -+/* ((p)->p_sig &~ ((p)->p_sigignore | (p)->p_sigmask))) && issig())*/ - - #define NBPW sizeof(int) /* number of bytes in an integer */ - -@@ -174,12 +175,16 @@ - /* - * Macros for counting and rounding. - */ --#ifndef howmany -+/* formerly duplicated in sys/types.h, but we now get it from here */ -+/*#ifndef howmany*/ - #define howmany(x, y) (((x)+((y)-1))/(y)) --#endif -+/*#endif*/ - #define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) - - /* - * Maximum size of hostname recognized and stored in the kernel. - */ - #define MAXHOSTNAMELEN 64 -+ -+/* moved this from sys/types.h */ -+#define NBBY 8 /* number of bits in a byte */ -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/sys/proc.h libx_c/sys/proc.h ---- libx_c.pre/sys/proc.h 2017-01-23 12:53:13.675903812 +1100 -+++ libx_c/sys/proc.h 2017-01-23 12:53:13.691903847 +1100 -@@ -117,3 +117,8 @@ - #define SSEL 0x0400000 /* selecting; wakeup/waiting danger */ - #define SLOGIN 0x0800000 /* a login process (legit child of init) */ - #define SPTECHG 0x1000000 /* pte's for process have changed */ -+ -+/* moved this from sys/param.h to avoid a circular dependency */ -+#define ISSIG(p) \ -+ ((p)->p_sig && ((p)->p_flag&STRC || \ -+ ((p)->p_sig &~ ((p)->p_sigignore | (p)->p_sigmask))) && issig()) -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/sys/select.h libx_c/sys/select.h ---- libx_c.pre/sys/select.h 1970-01-01 10:00:00.000000000 +1000 -+++ libx_c/sys/select.h 2017-01-23 12:53:13.691903847 +1100 -@@ -0,0 +1,28 @@ -+#include -+ -+/* moved this from sys/types.h */ -+/* -+ * Select uses bit masks of file descriptors in longs. -+ * These macros manipulate such bit fields (the filesystem macros use chars). -+ * FD_SETSIZE may be defined by the user, but the default here -+ * should be >= NOFILE (param.h). -+ */ -+#ifndef FD_SETSIZE -+#define FD_SETSIZE 256 -+#endif -+ -+typedef long fd_mask; -+#define NFDBITS (sizeof(fd_mask) * NBBY) /* bits per mask */ -+/* this was duplicated in sys/param.h, get it from there */ -+/*#ifndef howmany*/ -+/*#define howmany(x, y) (((x)+((y)-1))/(y))*/ -+/*#endif*/ -+ -+typedef struct fd_set { -+ fd_mask fds_bits[howmany(FD_SETSIZE, NFDBITS)]; -+} fd_set; -+ -+#define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS))) -+#define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS))) -+#define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS))) -+#define FD_ZERO(p) bzero((char *)(p), sizeof(*(p))) -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/sys/signal.h libx_c/sys/signal.h ---- libx_c.pre/sys/signal.h 2017-01-23 12:53:13.675903812 +1100 -+++ libx_c/sys/signal.h 2017-01-23 12:53:13.691903847 +1100 -@@ -57,14 +57,14 @@ - #define SIGUSR2 31 /* user defined signal 2 */ - - #ifndef KERNEL --int (*signal())(); -+void (*signal())(); - #endif - - /* - * Signal vector "template" used in sigvec call. - */ - struct sigvec { -- int (*sv_handler)(); /* signal handler */ -+ void (*sv_handler)(); /* signal handler */ - int sv_mask; /* signal mask to apply */ - int sv_flags; /* see signal options below */ - }; -@@ -97,13 +97,13 @@ - int sc_ps; /* psl to restore */ - }; - --#define BADSIG (int (*)())-1 --#define SIG_DFL (int (*)())0 --#define SIG_IGN (int (*)())1 -+#define BADSIG (void (*)())-1 -+#define SIG_DFL (void (*)())0 -+#define SIG_IGN (void (*)())1 - - #ifdef KERNEL --#define SIG_CATCH (int (*)())2 --#define SIG_HOLD (int (*)())3 -+#define SIG_CATCH (void (*)())2 -+#define SIG_HOLD (void (*)())3 - #endif - #endif - -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/sys/tty.h libx_c/sys/tty.h ---- libx_c.pre/sys/tty.h 2017-01-23 12:53:13.675903812 +1100 -+++ libx_c/sys/tty.h 2017-01-23 12:53:13.691903847 +1100 -@@ -70,20 +70,22 @@ - struct ttychars t_chars; /* tty */ - struct winsize t_winsize; /* window size */ - /* be careful of tchars & co. */ --#define t_erase t_chars.tc_erase --#define t_kill t_chars.tc_kill --#define t_intrc t_chars.tc_intrc --#define t_quitc t_chars.tc_quitc --#define t_startc t_chars.tc_startc --#define t_stopc t_chars.tc_stopc --#define t_eofc t_chars.tc_eofc --#define t_brkc t_chars.tc_brkc --#define t_suspc t_chars.tc_suspc --#define t_dsuspc t_chars.tc_dsuspc --#define t_rprntc t_chars.tc_rprntc --#define t_flushc t_chars.tc_flushc --#define t_werasc t_chars.tc_werasc --#define t_lnextc t_chars.tc_lnextc -+/* these macros can be reinstated later, in just the *.c files that use them */ -+/* otherwise they're too dangerous, they conflict with ioctl.h which we need */ -+/*#define t_erase t_chars.tc_erase*/ -+/*#define t_kill t_chars.tc_kill*/ -+/*#define t_intrc t_chars.tc_intrc*/ -+/*#define t_quitc t_chars.tc_quitc*/ -+/*#define t_startc t_chars.tc_startc*/ -+/*#define t_stopc t_chars.tc_stopc*/ -+/*#define t_eofc t_chars.tc_eofc*/ -+/*#define t_brkc t_chars.tc_brkc*/ -+/*#define t_suspc t_chars.tc_suspc*/ -+/*#define t_dsuspc t_chars.tc_dsuspc*/ -+/*#define t_rprntc t_chars.tc_rprntc*/ -+/*#define t_flushc t_chars.tc_flushc*/ -+/*#define t_werasc t_chars.tc_werasc*/ -+/*#define t_lnextc t_chars.tc_lnextc*/ - }; - - #define TTIPRI 28 -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/sys/types.h libx_c/sys/types.h ---- libx_c.pre/sys/types.h 2017-01-23 12:53:13.675903812 +1100 -+++ libx_c/sys/types.h 2017-01-23 12:53:13.691903847 +1100 -@@ -35,7 +35,7 @@ - #endif - typedef struct _quad { long val[2]; } quad; - typedef long daddr_t; --typedef char * caddr_t; -+typedef void * caddr_t; - typedef u_long ino_t; - typedef long swblk_t; - typedef long size_t; -@@ -45,30 +45,32 @@ - typedef u_short uid_t; - typedef u_short gid_t; - --#define NBBY 8 /* number of bits in a byte */ -+/* moved this to sys/param.h */ -+/*#define NBBY 8*/ /* number of bits in a byte */ -+/* moved this to sys/select.h */ - /* - * Select uses bit masks of file descriptors in longs. - * These macros manipulate such bit fields (the filesystem macros use chars). - * FD_SETSIZE may be defined by the user, but the default here - * should be >= NOFILE (param.h). - */ --#ifndef FD_SETSIZE --#define FD_SETSIZE 256 --#endif -+/*#ifndef FD_SETSIZE*/ -+/*#define FD_SETSIZE 256*/ -+/*#endif*/ - --typedef long fd_mask; --#define NFDBITS (sizeof(fd_mask) * NBBY) /* bits per mask */ --#ifndef howmany --#define howmany(x, y) (((x)+((y)-1))/(y)) --#endif -+/*typedef long fd_mask;*/ -+/*#define NFDBITS (sizeof(fd_mask) * NBBY)*/ /* bits per mask */ -+/*#ifndef howmany*/ -+/*#define howmany(x, y) (((x)+((y)-1))/(y))*/ -+/*#endif*/ - --typedef struct fd_set { -- fd_mask fds_bits[howmany(FD_SETSIZE, NFDBITS)]; --} fd_set; -+/*typedef struct fd_set {*/ -+/* fd_mask fds_bits[howmany(FD_SETSIZE, NFDBITS)];*/ -+/*} fd_set;*/ - --#define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS))) --#define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS))) --#define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS))) --#define FD_ZERO(p) bzero((char *)(p), sizeof(*(p))) -+/*#define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS)))*/ -+/*#define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS)))*/ -+/*#define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS)))*/ -+/*#define FD_ZERO(p) bzero((char *)(p), sizeof(*(p)))*/ - - #endif -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/sys/vfork.c libx_c/sys/vfork.c ---- libx_c.pre/sys/vfork.c 1970-01-01 10:00:00.000000000 +1000 -+++ libx_c/sys/vfork.c 2017-01-23 12:53:13.691903847 +1100 -@@ -0,0 +1,4 @@ -+int vfork() { -+ write(2, "vfork()\n", 8); -+ abort(); -+} -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/sys/vmmac.h libx_c/sys/vmmac.h ---- libx_c.pre/sys/vmmac.h 2017-01-23 12:53:13.675903812 +1100 -+++ libx_c/sys/vmmac.h 2017-01-23 12:53:13.691903847 +1100 -@@ -157,3 +157,10 @@ - } \ - c->c_lock = 0; \ - } -+ -+/* -+ * BEWARE THIS DEFINITION WORKS ONLY WITH COUNT OF 1 -+ */ -+/* moved this from sys/vmmac.h to avoid a circular dependency */ -+#define mapin(pte, v, pfnum, count, prot) \ -+ (*(int *)(pte) = (pfnum) | (prot), mtpr(TBIS, ptob(v))) -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/sys/vopen.c libx_c/sys/vopen.c ---- libx_c.pre/sys/vopen.c 1970-01-01 10:00:00.000000000 +1000 -+++ libx_c/sys/vopen.c 2017-01-23 12:53:13.691903847 +1100 -@@ -0,0 +1,6 @@ -+#include -+#include -+ -+int vopen(f, m, argp) char *f; va_list argp; { -+ return open(f, m, m & O_CREAT ? va_arg(argp, int) : 0); -+} -diff --unified --recursive --new-file '--exclude=[abcdefghijklmnopqrstuvwxyz]' '--exclude=*.sh' '--exclude=*.a' '--exclude=*.o' '--exclude=*.[ch].nocomm' '--exclude=*.[ch].protos' '--exclude=*.[ch].protos.nocomm' '--exclude=*.temp' '--exclude=*.temp.c' '--exclude=*.[ch].usedby' '--exclude=*.[ch].uses' libx_c.pre/vax/vmparam.h libx_c/vax/vmparam.h ---- libx_c.pre/vax/vmparam.h 2017-01-23 12:53:13.679903821 +1100 -+++ libx_c/vax/vmparam.h 2017-01-23 12:53:13.691903847 +1100 -@@ -156,5 +156,6 @@ - /* - * BEWARE THIS DEFINITION WORKS ONLY WITH COUNT OF 1 - */ --#define mapin(pte, v, pfnum, count, prot) \ -- (*(int *)(pte) = (pfnum) | (prot), mtpr(TBIS, ptob(v))) -+/* moved this to sys/vmmac.h to avoid a circular dependency */ -+/*#define mapin(pte, v, pfnum, count, prot) \ -+ (*(int *)(pte) = (pfnum) | (prot), mtpr(TBIS, ptob(v)))*/ diff --git a/sys/h/dir.h b/sys/h/dir.h index aaf362a..913a549 100644 --- a/sys/h/dir.h +++ b/sys/h/dir.h @@ -32,9 +32,9 @@ * dp->d_ino set to 0. */ /* so user programs can just include dir.h */ -#if !defined(KERNEL) && !defined(DEV_BSIZE) -#define DEV_BSIZE 512 -#endif +/*#if !defined(KERNEL) && !defined(DEV_BSIZE)*/ +/*#define DEV_BSIZE 512*/ +/*#endif*/ #define DIRBLKSIZ DEV_BSIZE #define MAXNAMLEN 255 diff --git a/sys/h/errno.h b/sys/h/errno.h index cf0fd68..275be9a 100644 --- a/sys/h/errno.h +++ b/sys/h/errno.h @@ -96,3 +96,7 @@ #define EPROCLIM 67 /* Too many processes */ #define EUSERS 68 /* Too many users */ #define EDQUOT 69 /* Disc quota exceeded */ + +#ifndef KERNEL +extern int errno; +#endif diff --git a/sys/h/param.h b/sys/h/param.h index f7c5c2a..e02688c 100644 --- a/sys/h/param.h +++ b/sys/h/param.h @@ -53,15 +53,16 @@ /* * Signals */ -#ifdef KERNEL -#include "signal.h" -#else -#include -#endif +/*#ifdef KERNEL*/ +/*#include "signal.h"*/ +/*#else*/ +/*#include */ +/*#endif*/ -#define ISSIG(p) \ - ((p)->p_sig && ((p)->p_flag&STRC || \ - ((p)->p_sig &~ ((p)->p_sigignore | (p)->p_sigmask))) && issig()) +/* moved this to sys/proc.h to avoid a circular dependency */ +/*#define ISSIG(p) \*/ +/* ((p)->p_sig && ((p)->p_flag&STRC || \*/ +/* ((p)->p_sig &~ ((p)->p_sigignore | (p)->p_sigmask))) && issig())*/ #define NBPW sizeof(int) /* number of bytes in an integer */ @@ -174,12 +175,16 @@ /* * Macros for counting and rounding. */ -#ifndef howmany +/* formerly duplicated in sys/types.h, but we now get it from here */ +/*#ifndef howmany*/ #define howmany(x, y) (((x)+((y)-1))/(y)) -#endif +/*#endif*/ #define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) /* * Maximum size of hostname recognized and stored in the kernel. */ #define MAXHOSTNAMELEN 64 + +/* moved this from sys/types.h */ +#define NBBY 8 /* number of bits in a byte */ diff --git a/sys/h/proc.h b/sys/h/proc.h index b81c5cb..5d069b0 100644 --- a/sys/h/proc.h +++ b/sys/h/proc.h @@ -117,3 +117,8 @@ int whichqs; /* bit mask summarizing non-empty qs's */ #define SSEL 0x0400000 /* selecting; wakeup/waiting danger */ #define SLOGIN 0x0800000 /* a login process (legit child of init) */ #define SPTECHG 0x1000000 /* pte's for process have changed */ + +/* moved this from sys/param.h to avoid a circular dependency */ +#define ISSIG(p) \ + ((p)->p_sig && ((p)->p_flag&STRC || \ + ((p)->p_sig &~ ((p)->p_sigignore | (p)->p_sigmask))) && issig()) diff --git a/sys/h/select.h b/sys/h/select.h new file mode 100644 index 0000000..c861a51 --- /dev/null +++ b/sys/h/select.h @@ -0,0 +1,28 @@ +#include + +/* moved this from sys/types.h */ +/* + * Select uses bit masks of file descriptors in longs. + * These macros manipulate such bit fields (the filesystem macros use chars). + * FD_SETSIZE may be defined by the user, but the default here + * should be >= NOFILE (param.h). + */ +#ifndef FD_SETSIZE +#define FD_SETSIZE 256 +#endif + +typedef long fd_mask; +#define NFDBITS (sizeof(fd_mask) * NBBY) /* bits per mask */ +/* this was duplicated in sys/param.h, get it from there */ +/*#ifndef howmany*/ +/*#define howmany(x, y) (((x)+((y)-1))/(y))*/ +/*#endif*/ + +typedef struct fd_set { + fd_mask fds_bits[howmany(FD_SETSIZE, NFDBITS)]; +} fd_set; + +#define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS))) +#define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS))) +#define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS))) +#define FD_ZERO(p) bzero((char *)(p), sizeof(*(p))) diff --git a/sys/h/signal.h b/sys/h/signal.h index e08cebc..3242faf 100644 --- a/sys/h/signal.h +++ b/sys/h/signal.h @@ -57,14 +57,14 @@ #define SIGUSR2 31 /* user defined signal 2 */ #ifndef KERNEL -int (*signal())(); +void (*signal())(); #endif /* * Signal vector "template" used in sigvec call. */ struct sigvec { - int (*sv_handler)(); /* signal handler */ + void (*sv_handler)(); /* signal handler */ int sv_mask; /* signal mask to apply */ int sv_flags; /* see signal options below */ }; @@ -97,13 +97,13 @@ struct sigcontext { int sc_ps; /* psl to restore */ }; -#define BADSIG (int (*)())-1 -#define SIG_DFL (int (*)())0 -#define SIG_IGN (int (*)())1 +#define BADSIG (void (*)())-1 +#define SIG_DFL (void (*)())0 +#define SIG_IGN (void (*)())1 #ifdef KERNEL -#define SIG_CATCH (int (*)())2 -#define SIG_HOLD (int (*)())3 +#define SIG_CATCH (void (*)())2 +#define SIG_HOLD (void (*)())3 #endif #endif diff --git a/sys/h/tty.h b/sys/h/tty.h index 44e1d80..fe4ca20 100644 --- a/sys/h/tty.h +++ b/sys/h/tty.h @@ -70,20 +70,22 @@ struct tty { struct ttychars t_chars; /* tty */ struct winsize t_winsize; /* window size */ /* be careful of tchars & co. */ -#define t_erase t_chars.tc_erase -#define t_kill t_chars.tc_kill -#define t_intrc t_chars.tc_intrc -#define t_quitc t_chars.tc_quitc -#define t_startc t_chars.tc_startc -#define t_stopc t_chars.tc_stopc -#define t_eofc t_chars.tc_eofc -#define t_brkc t_chars.tc_brkc -#define t_suspc t_chars.tc_suspc -#define t_dsuspc t_chars.tc_dsuspc -#define t_rprntc t_chars.tc_rprntc -#define t_flushc t_chars.tc_flushc -#define t_werasc t_chars.tc_werasc -#define t_lnextc t_chars.tc_lnextc +/* these macros can be reinstated later, in just the *.c files that use them */ +/* otherwise they're too dangerous, they conflict with ioctl.h which we need */ +/*#define t_erase t_chars.tc_erase*/ +/*#define t_kill t_chars.tc_kill*/ +/*#define t_intrc t_chars.tc_intrc*/ +/*#define t_quitc t_chars.tc_quitc*/ +/*#define t_startc t_chars.tc_startc*/ +/*#define t_stopc t_chars.tc_stopc*/ +/*#define t_eofc t_chars.tc_eofc*/ +/*#define t_brkc t_chars.tc_brkc*/ +/*#define t_suspc t_chars.tc_suspc*/ +/*#define t_dsuspc t_chars.tc_dsuspc*/ +/*#define t_rprntc t_chars.tc_rprntc*/ +/*#define t_flushc t_chars.tc_flushc*/ +/*#define t_werasc t_chars.tc_werasc*/ +/*#define t_lnextc t_chars.tc_lnextc*/ }; #define TTIPRI 28 diff --git a/sys/h/types.h b/sys/h/types.h index db61842..37498ac 100644 --- a/sys/h/types.h +++ b/sys/h/types.h @@ -35,7 +35,7 @@ typedef struct label_t { #endif typedef struct _quad { long val[2]; } quad; typedef long daddr_t; -typedef char * caddr_t; +typedef void * caddr_t; typedef u_long ino_t; typedef long swblk_t; typedef long size_t; @@ -45,30 +45,32 @@ typedef long off_t; typedef u_short uid_t; typedef u_short gid_t; -#define NBBY 8 /* number of bits in a byte */ +/* moved this to sys/param.h */ +/*#define NBBY 8*/ /* number of bits in a byte */ +/* moved this to sys/select.h */ /* * Select uses bit masks of file descriptors in longs. * These macros manipulate such bit fields (the filesystem macros use chars). * FD_SETSIZE may be defined by the user, but the default here * should be >= NOFILE (param.h). */ -#ifndef FD_SETSIZE -#define FD_SETSIZE 256 -#endif +/*#ifndef FD_SETSIZE*/ +/*#define FD_SETSIZE 256*/ +/*#endif*/ -typedef long fd_mask; -#define NFDBITS (sizeof(fd_mask) * NBBY) /* bits per mask */ -#ifndef howmany -#define howmany(x, y) (((x)+((y)-1))/(y)) -#endif +/*typedef long fd_mask;*/ +/*#define NFDBITS (sizeof(fd_mask) * NBBY)*/ /* bits per mask */ +/*#ifndef howmany*/ +/*#define howmany(x, y) (((x)+((y)-1))/(y))*/ +/*#endif*/ -typedef struct fd_set { - fd_mask fds_bits[howmany(FD_SETSIZE, NFDBITS)]; -} fd_set; +/*typedef struct fd_set {*/ +/* fd_mask fds_bits[howmany(FD_SETSIZE, NFDBITS)];*/ +/*} fd_set;*/ -#define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS))) -#define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS))) -#define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS))) -#define FD_ZERO(p) bzero((char *)(p), sizeof(*(p))) +/*#define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS)))*/ +/*#define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS)))*/ +/*#define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS)))*/ +/*#define FD_ZERO(p) bzero((char *)(p), sizeof(*(p)))*/ #endif diff --git a/sys/h/vmmac.h b/sys/h/vmmac.h index 99d965c..6581ea6 100644 --- a/sys/h/vmmac.h +++ b/sys/h/vmmac.h @@ -157,3 +157,10 @@ struct pte *vtopte(); } \ c->c_lock = 0; \ } + +/* + * BEWARE THIS DEFINITION WORKS ONLY WITH COUNT OF 1 + */ +/* moved this from sys/vmmac.h to avoid a circular dependency */ +#define mapin(pte, v, pfnum, count, prot) \ + (*(int *)(pte) = (pfnum) | (prot), mtpr(TBIS, ptob(v))) diff --git a/sys/netinet/in.h b/sys/netinet/in.h index 4abef17..1921022 100644 --- a/sys/netinet/in.h +++ b/sys/netinet/in.h @@ -90,20 +90,11 @@ struct sockaddr_in { */ #define IP_OPTIONS 1 /* set/get IP per-packet options */ -#if !defined(vax) && !defined(ntohl) && !defined(lint) /* - * Macros for number representation conversion. + * Functions for number representation conversion. */ -#define ntohl(x) (x) -#define ntohs(x) (x) -#define htonl(x) (x) -#define htons(x) (x) -#endif - -#if !defined(ntohl) && (defined(vax) || defined(lint)) u_short ntohs(), htons(); u_long ntohl(), htonl(); -#endif #ifdef KERNEL extern struct domain inetdomain; diff --git a/sys/netinet/ip.h b/sys/netinet/ip.h index 17d93e4..809778c 100644 --- a/sys/netinet/ip.h +++ b/sys/netinet/ip.h @@ -81,7 +81,7 @@ struct ip_timestamp { struct in_addr ipt_addr; n_long ipt_time; } ipt_ta[1]; - } + }; }; /* flag bits for ipt_flg */ diff --git a/sys/netinet/tcp.h b/sys/netinet/tcp.h index 3f2f4d3..8409c43 100644 --- a/sys/netinet/tcp.h +++ b/sys/netinet/tcp.h @@ -44,7 +44,9 @@ struct tcphdr { #ifdef lint #define TCP_MSS 536 #else -#define TCP_MSS MIN(512, IP_MSS - sizeof (struct tcpiphdr)) +/* redefined this to avoid a circular dependency */ +/*#define TCP_MSS MIN(512, IP_MSS - sizeof (struct tcpiphdr))*/ +#define TCP_MSS MIN(512, IP_MSS - sizeof(struct ipovly) - sizeof(struct tcphdr)) #endif /* diff --git a/sys/netns/ns.h b/sys/netns/ns.h index 63b8a86..5fdf1e7 100644 --- a/sys/netns/ns.h +++ b/sys/netns/ns.h @@ -103,20 +103,11 @@ struct sockaddr_ns { #define ns_nullhost(x) (((x).x_host.s_host[0]==0) && \ ((x).x_host.s_host[1]==0) && ((x).x_host.s_host[2]==0)) -#if !defined(vax) && !defined(ntohl) && !defined(lint) /* - * Macros for number representation conversion. + * Functions for number representation conversion. */ -#define ntohl(x) (x) -#define ntohs(x) (x) -#define htonl(x) (x) -#define htons(x) (x) -#endif - -#if !defined(ntohl) && (defined(vax) || defined(lint)) u_short ntohs(), htons(); u_long ntohl(), htonl(); -#endif #ifdef KERNEL extern struct domain nsdomain; diff --git a/sys/vax/vmparam.h b/sys/vax/vmparam.h index ed0f50e..a17cf61 100644 --- a/sys/vax/vmparam.h +++ b/sys/vax/vmparam.h @@ -156,5 +156,6 @@ /* * BEWARE THIS DEFINITION WORKS ONLY WITH COUNT OF 1 */ -#define mapin(pte, v, pfnum, count, prot) \ - (*(int *)(pte) = (pfnum) | (prot), mtpr(TBIS, ptob(v))) +/* moved this to sys/vmmac.h to avoid a circular dependency */ +/*#define mapin(pte, v, pfnum, count, prot) \ + (*(int *)(pte) = (pfnum) | (prot), mtpr(TBIS, ptob(v)))*/