Permanently apply syscall stubs and pre.patch changes to various directories
authorNick Downing <downing.nick@gmail.com>
Mon, 23 Jan 2017 02:14:55 +0000 (13:14 +1100)
committerNick Downing <downing.nick@gmail.com>
Mon, 23 Jan 2017 02:14:55 +0000 (13:14 +1100)
218 files changed:
.gitignore
include/curses.h [deleted symlink]
include/fcntl.h [deleted file]
include/gen.h [new file with mode: 0644]
include/mp.h [deleted file]
include/net.h [new file with mode: 0644]
include/nlist.h [deleted file]
include/stdio.h
lib/libc/compat-4.1/Makefile
lib/libc/compat-4.1/ftime.c
lib/libc/compat-4.1/gtty.c
lib/libc/compat-4.1/stty.c
lib/libc/compat-4.1/times.c
lib/libc/compat-4.1/vtimes.c
lib/libc/compat-sys5/Makefile
lib/libc/compat-sys5/memccpy.c
lib/libc/compat-sys5/memchr.c
lib/libc/compat-sys5/memcmp.c
lib/libc/compat-sys5/memcpy.c
lib/libc/compat-sys5/memset.c
lib/libc/gen/Makefile
lib/libc/gen/_setjmp.c [new file with mode: 0644]
lib/libc/gen/abs.c [new file with mode: 0644]
lib/libc/gen/atof.c [new file with mode: 0644]
lib/libc/gen/bcmp.c [new file with mode: 0644]
lib/libc/gen/bcopy.c [new file with mode: 0644]
lib/libc/gen/bzero.c [new file with mode: 0644]
lib/libc/gen/calloc.c
lib/libc/gen/disktab.c [new file with mode: 0644]
lib/libc/gen/ecvt.c [new file with mode: 0644]
lib/libc/gen/fakcu.c
lib/libc/gen/ffs.c [new file with mode: 0644]
lib/libc/gen/getpass.c
lib/libc/gen/getusershell.c
lib/libc/gen/insque.c [new file with mode: 0644]
lib/libc/gen/ldexp.c [new file with mode: 0644]
lib/libc/gen/malloc.c
lib/libc/gen/modf.c [new file with mode: 0644]
lib/libc/gen/ndbm.c
lib/libc/gen/perror.c
lib/libc/gen/qsort.c
lib/libc/gen/random.c
lib/libc/gen/regex.c
lib/libc/gen/remque.c [new file with mode: 0644]
lib/libc/gen/setjmp.c [new file with mode: 0644]
lib/libc/gen/setjmperr.c [new file with mode: 0644]
lib/libc/gen/signal.c
lib/libc/gen/sleep.c
lib/libc/gen/syslog.c
lib/libc/gen/system.c
lib/libc/gen/usleep.c
lib/libc/gen/valloc.c
lib/libc/inet/Makefile
lib/libc/net/Makefile
lib/libc/net/hosttable/Makefile
lib/libc/net/htonl.c [new file with mode: 0644]
lib/libc/net/htons.c [new file with mode: 0644]
lib/libc/net/named/Makefile
lib/libc/net/ntohl.c [new file with mode: 0644]
lib/libc/net/ntohs.c [new file with mode: 0644]
lib/libc/net/rcmd.c
lib/libc/net/res_debug.c
lib/libc/net/res_mkquery.c
lib/libc/net/res_send.c
lib/libc/net/rexec.c
lib/libc/net/ruserpass.c
lib/libc/ns/Makefile
lib/libc/ns/ns_addr.c
lib/libc/stdio/Makefile
lib/libc/stdio/doprnt.c [new file with mode: 0644]
lib/libc/stdio/doscan.c
lib/libc/stdio/findiop.c
lib/libc/stdio/fprintf.c
lib/libc/stdio/fread.c
lib/libc/stdio/fwrite.c
lib/libc/stdio/popen.c [moved from lib/libc/gen/popen.c with 96% similarity]
lib/libc/stdio/printf.c
lib/libc/stdio/scanf.c
lib/libc/stdio/setbuffer.c
lib/libc/stdio/sprintf.c
lib/libc/stdio/vfprintf.c [new file with mode: 0644]
lib/libc/stdio/vprintf.c [new file with mode: 0644]
lib/libc/stdio/vsprintf.c [new file with mode: 0644]
lib/libc/sys/Makefile [new file with mode: 0644]
lib/libc/sys/_exit.c [new file with mode: 0644]
lib/libc/sys/accept.c [new file with mode: 0644]
lib/libc/sys/access.c [new file with mode: 0644]
lib/libc/sys/acct.c [new file with mode: 0644]
lib/libc/sys/adjtime.c [new file with mode: 0644]
lib/libc/sys/bind.c [new file with mode: 0644]
lib/libc/sys/brk.c [new file with mode: 0644]
lib/libc/sys/chdir.c [new file with mode: 0644]
lib/libc/sys/chmod.c [new file with mode: 0644]
lib/libc/sys/chown.c [new file with mode: 0644]
lib/libc/sys/chroot.c [new file with mode: 0644]
lib/libc/sys/close.c [new file with mode: 0644]
lib/libc/sys/connect.c [new file with mode: 0644]
lib/libc/sys/creat.c [new file with mode: 0644]
lib/libc/sys/dup.c [new file with mode: 0644]
lib/libc/sys/dup2.c [new file with mode: 0644]
lib/libc/sys/execl.c [new file with mode: 0644]
lib/libc/sys/execle.c [new file with mode: 0644]
lib/libc/sys/exect.c [new file with mode: 0644]
lib/libc/sys/execv.c [new file with mode: 0644]
lib/libc/sys/execve.c [new file with mode: 0644]
lib/libc/sys/fchmod.c [new file with mode: 0644]
lib/libc/sys/fchown.c [new file with mode: 0644]
lib/libc/sys/fcntl.c [new file with mode: 0644]
lib/libc/sys/flock.c [new file with mode: 0644]
lib/libc/sys/fork.c [new file with mode: 0644]
lib/libc/sys/fstat.c [new file with mode: 0644]
lib/libc/sys/fsync.c [new file with mode: 0644]
lib/libc/sys/ftruncate.c [new file with mode: 0644]
lib/libc/sys/getdtablesize.c [new file with mode: 0644]
lib/libc/sys/getegid.c [new file with mode: 0644]
lib/libc/sys/geteuid.c [new file with mode: 0644]
lib/libc/sys/getgid.c [new file with mode: 0644]
lib/libc/sys/getgroups.c [new file with mode: 0644]
lib/libc/sys/gethostid.c [new file with mode: 0644]
lib/libc/sys/gethostname.c [new file with mode: 0644]
lib/libc/sys/getitimer.c [new file with mode: 0644]
lib/libc/sys/getpagesize.c [new file with mode: 0644]
lib/libc/sys/getpeername.c [new file with mode: 0644]
lib/libc/sys/getpgrp.c [new file with mode: 0644]
lib/libc/sys/getpid.c [new file with mode: 0644]
lib/libc/sys/getppid.c [new file with mode: 0644]
lib/libc/sys/getpriority.c [new file with mode: 0644]
lib/libc/sys/getrlimit.c [new file with mode: 0644]
lib/libc/sys/getrusage.c [new file with mode: 0644]
lib/libc/sys/getsockname.c [new file with mode: 0644]
lib/libc/sys/getsockopt.c [new file with mode: 0644]
lib/libc/sys/gettimeofday.c [new file with mode: 0644]
lib/libc/sys/getuid.c [new file with mode: 0644]
lib/libc/sys/ioctl.c [new file with mode: 0644]
lib/libc/sys/isatty.c [moved from lib/libc/gen/isatty.c with 85% similarity]
lib/libc/sys/kill.c [new file with mode: 0644]
lib/libc/sys/killpg.c [new file with mode: 0644]
lib/libc/sys/link.c [new file with mode: 0644]
lib/libc/sys/listen.c [new file with mode: 0644]
lib/libc/sys/lseek.c [new file with mode: 0644]
lib/libc/sys/lstat.c [new file with mode: 0644]
lib/libc/sys/mkdir.c [new file with mode: 0644]
lib/libc/sys/mknod.c [new file with mode: 0644]
lib/libc/sys/mount.c [new file with mode: 0644]
lib/libc/sys/open.c [new file with mode: 0644]
lib/libc/sys/pipe.c [new file with mode: 0644]
lib/libc/sys/profil.c [new file with mode: 0644]
lib/libc/sys/ptrace.c [new file with mode: 0644]
lib/libc/sys/quota.c [new file with mode: 0644]
lib/libc/sys/read.c [new file with mode: 0644]
lib/libc/sys/readlink.c [new file with mode: 0644]
lib/libc/sys/readv.c [new file with mode: 0644]
lib/libc/sys/reboot.c [new file with mode: 0644]
lib/libc/sys/recv.c [new file with mode: 0644]
lib/libc/sys/recvfrom.c [new file with mode: 0644]
lib/libc/sys/recvmsg.c [new file with mode: 0644]
lib/libc/sys/rename.c [new file with mode: 0644]
lib/libc/sys/rmdir.c [new file with mode: 0644]
lib/libc/sys/sbrk.c [new file with mode: 0644]
lib/libc/sys/select.c [new file with mode: 0644]
lib/libc/sys/send.c [new file with mode: 0644]
lib/libc/sys/sendmsg.c [new file with mode: 0644]
lib/libc/sys/sendto.c [new file with mode: 0644]
lib/libc/sys/setgroups.c [new file with mode: 0644]
lib/libc/sys/sethostid.c [new file with mode: 0644]
lib/libc/sys/sethostname.c [new file with mode: 0644]
lib/libc/sys/setitimer.c [new file with mode: 0644]
lib/libc/sys/setpgrp.c [new file with mode: 0644]
lib/libc/sys/setpriority.c [new file with mode: 0644]
lib/libc/sys/setquota.c [new file with mode: 0644]
lib/libc/sys/setregid.c [new file with mode: 0644]
lib/libc/sys/setreuid.c [new file with mode: 0644]
lib/libc/sys/setrlimit.c [new file with mode: 0644]
lib/libc/sys/setsockopt.c [new file with mode: 0644]
lib/libc/sys/settimeofday.c [new file with mode: 0644]
lib/libc/sys/shutdown.c [new file with mode: 0644]
lib/libc/sys/sigblock.c [new file with mode: 0644]
lib/libc/sys/sigpause.c [new file with mode: 0644]
lib/libc/sys/sigreturn.c [new file with mode: 0644]
lib/libc/sys/sigsetmask.c [new file with mode: 0644]
lib/libc/sys/sigstack.c [new file with mode: 0644]
lib/libc/sys/sigvec.c [new file with mode: 0644]
lib/libc/sys/socket.c [new file with mode: 0644]
lib/libc/sys/socketpair.c [new file with mode: 0644]
lib/libc/sys/stat.c [new file with mode: 0644]
lib/libc/sys/swapon.c [new file with mode: 0644]
lib/libc/sys/symlink.c [new file with mode: 0644]
lib/libc/sys/sync.c [new file with mode: 0644]
lib/libc/sys/truncate.c [new file with mode: 0644]
lib/libc/sys/umask.c [new file with mode: 0644]
lib/libc/sys/umount.c [new file with mode: 0644]
lib/libc/sys/unlink.c [new file with mode: 0644]
lib/libc/sys/utimes.c [new file with mode: 0644]
lib/libc/sys/vfork.c [new file with mode: 0644]
lib/libc/sys/vhangup.c [new file with mode: 0644]
lib/libc/sys/vopen.c [new file with mode: 0644]
lib/libc/sys/wait.c [new file with mode: 0644]
lib/libc/sys/wait3.c [new file with mode: 0644]
lib/libc/sys/write.c [new file with mode: 0644]
lib/libc/sys/writev.c [new file with mode: 0644]
lib/libx_c/mkprepatch.sh [deleted file]
lib/libx_c/n.sh
lib/libx_c/o.sh
lib/libx_c/pre.patch [deleted file]
sys/h/dir.h
sys/h/errno.h
sys/h/param.h
sys/h/proc.h
sys/h/select.h [new file with mode: 0644]
sys/h/signal.h
sys/h/tty.h
sys/h/types.h
sys/h/vmmac.h
sys/netinet/in.h
sys/netinet/ip.h
sys/netinet/tcp.h
sys/netns/ns.h
sys/vax/vmparam.h

index 83a041d..2d4712f 100644 (file)
@@ -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 (symlink)
index 6c8cd06..0000000
+++ /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 (file)
index 5fd458f..0000000
+++ /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
- * <sys/file.h>.  (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 <sys/file.h> */
-#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 (file)
index 0000000..c0a77d9
--- /dev/null
@@ -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 (file)
index 05a1d39..0000000
+++ /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 <stdio.h>
-#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 (file)
index 0000000..7c94432
--- /dev/null
@@ -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 (file)
index 6b5b8ba..0000000
+++ /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 <a.out.h>
- * 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 <stab.h> */
-       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 <stab.h>
- */
-#define        N_STAB  0xe0            /* if any of these bits set, a SDB entry */
-
-/*
- * Format for namelist values.
- */
-#define        N_FORMAT        "%08x"
index 2001be8..ca9648c 100644 (file)
@@ -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
index 927aac7..4080fd5 100644 (file)
@@ -59,4 +59,3 @@ depend:
 
 # DO NOT DELETE THIS LINE -- make depend uses it
 
-
index 243902d..ec24405 100644 (file)
@@ -10,18 +10,20 @@ static char sccsid[] = "@(#)ftime.c 5.2 (Berkeley) 3/9/86";
 
 #include <sys/types.h>
 #include <sys/time.h>
+#include <sys/timeb.h>
 
 /*
  * 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;
index 9e589ae..7c4372c 100644 (file)
@@ -15,8 +15,7 @@ static char sccsid[] = "@(#)gtty.c    5.2 (Berkeley) 3/9/86";
 #include <sgtty.h>
 
 gtty(fd, ap)
-       struct sgtty *ap;
+       struct sgttyb *ap;
 {
-
        return(ioctl(fd, TIOCGETP, ap));
 }
index 6253baf..beb475a 100644 (file)
@@ -15,8 +15,7 @@ static char sccsid[] = "@(#)stty.c    5.2 (Berkeley) 3/9/86";
 #include <sgtty.h>
 
 stty(fd, ap)
-       struct sgtty *ap;
+       struct sgttyb *ap;
 {
-
        return(ioctl(fd, TIOCSETP, ap));
 }
index 7843072..8293649 100644 (file)
@@ -10,16 +10,18 @@ static char sccsid[] = "@(#)times.c 5.2 (Berkeley) 3/9/86";
 
 #include <sys/time.h>
 #include <sys/resource.h>
+#include <sys/times.h>
 
 /*
  * 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;
index e689501..cb3b61b 100644 (file)
@@ -10,23 +10,25 @@ static char sccsid[] = "@(#)vtimes.c        5.2 (Berkeley) 3/9/86";
 
 #include <sys/time.h>
 #include <sys/resource.h>
+#include <sys/vtimes.h>
 
 /*
  * 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;
index 4aa6b25..4af68bc 100644 (file)
@@ -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
index 381a24f..9bed847 100644 (file)
@@ -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
 }
index 3093347..14fb81c 100644 (file)
 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
 }
index e6b2a50..f2cd066 100644 (file)
 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
 }
index 487fd70..29e06af 100644 (file)
 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
 }
index 2600ed5..7769840 100644 (file)
 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
 }
index 37273f7..9415798 100644 (file)
@@ -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 (file)
index 0000000..f4be53d
--- /dev/null
@@ -0,0 +1,10 @@
+#include <setjmp.h>
+
+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 (file)
index 0000000..0988e86
--- /dev/null
@@ -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 (file)
index 0000000..1516cf5
--- /dev/null
@@ -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 (file)
index 0000000..c98c535
--- /dev/null
@@ -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 (file)
index 0000000..503440f
--- /dev/null
@@ -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 (file)
index 0000000..6a7c786
--- /dev/null
@@ -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
+}
index 20e5422..5c5ac2a 100644 (file)
@@ -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 (file)
index 0000000..4546c53
--- /dev/null
@@ -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 <disktab.h>
+#include <stdio.h>
+
+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 <ctype.h>
+
+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 (file)
index 0000000..fd84d3b
--- /dev/null
@@ -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);
+}
index f69e296..e737ba2 100644 (file)
@@ -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 (file)
index 0000000..9cdd64b
--- /dev/null
@@ -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);
+}
index 8142fdf..a782812 100644 (file)
@@ -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;
index f9fe9ae..24258e7 100644 (file)
@@ -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 (file)
index 0000000..9ea7b25
--- /dev/null
@@ -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 <gen.h>
+
+/*
+ * 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 (file)
index 0000000..c94cfdf
--- /dev/null
@@ -0,0 +1,4 @@
+double ldexp(v, e) double v; {
+       write(2, "ldexp()\n", 8);
+       abort();
+}
index 4d200ed..27bb9b4 100644 (file)
@@ -82,7 +82,7 @@ static        u_int nmalloc[NBUCKETS];
 #if defined(DEBUG) || defined(RCHECK)
 #define        ASSERT(p)   if (!(p)) botch("p")
 #include <stdio.h>
-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 (file)
index 0000000..babd583
--- /dev/null
@@ -0,0 +1,4 @@
+double modf(v, p) double v, *p; {
+       write(2, "modf()\n", 7);
+       abort();
+}
index 5bf670f..4db66f0 100644 (file)
@@ -14,6 +14,7 @@ static char sccsid[] = "@(#)ndbm.c    5.3 (Berkeley) 3/9/86";
 #include <stdio.h>
 #include <errno.h>
 #include <ndbm.h>
+#include <varargs.h>
 
 #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);
index c3bec72..9742026 100644 (file)
@@ -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;
 {
index 4e85c94..539bc41 100644 (file)
@@ -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;
index d8cdd9e..0f3c08a 100644 (file)
@@ -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;
index 73c1e0c..75c7146 100644 (file)
@@ -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 (file)
index 0000000..afd76e4
--- /dev/null
@@ -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 <gen.h>
+
+/*
+ * 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 (file)
index 0000000..7bc584e
--- /dev/null
@@ -0,0 +1,10 @@
+#include <setjmp.h>
+
+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 (file)
index 0000000..d46b7a6
--- /dev/null
@@ -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));
+}
index 7c0710a..d6bb2cf 100644 (file)
@@ -13,9 +13,10 @@ static char sccsid[] = "@(#)signal.c 5.2 (Berkeley) 3/9/86";
  */
 #include <signal.h>
 
-int (*
-signal(s, a))()
-       int s, (*a)();
+void
+(*signal(s, a))()
+       int s;
+       void (*a)();
 {
        struct sigvec osv, sv;
        static int mask[NSIG];
index d20389c..f5b7d0b 100644 (file)
@@ -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;
 }
index f0dcc80..075eb89 100644 (file)
@@ -32,6 +32,7 @@ static char sccsid[] = "@(#)syslog.c  5.9 (Berkeley) 5/7/86";
 #include <sys/syslog.h>
 #include <netdb.h>
 #include <strings.h>
+#include <varargs.h>
 
 #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;
 }
index b8cc181..6303403 100644 (file)
@@ -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);
index 0c9e6b0..1e4a431 100644 (file)
@@ -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;
 }
index 1388d1d..ecd3034 100644 (file)
@@ -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;
 {
index 39feaf1..34fc6d8 100644 (file)
@@ -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
index 1ece853..def2b5c 100644 (file)
@@ -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
index 60d43e3..5d9aad6 100644 (file)
@@ -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 (file)
index 0000000..1e2d219
--- /dev/null
@@ -0,0 +1,7 @@
+#include <sys/types.h>
+#include <net.h>
+
+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 (file)
index 0000000..1a33707
--- /dev/null
@@ -0,0 +1,7 @@
+#include <sys/types.h>
+#include <net.h>
+
+u_short htons(hostshort) u_short hostshort; {
+       write(2, "htons()\n", 8);
+       abort();
+}
index 8f86f10..6958409 100644 (file)
@@ -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 (file)
index 0000000..5c0c36e
--- /dev/null
@@ -0,0 +1,7 @@
+#include <sys/types.h>
+#include <net.h>
+
+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 (file)
index 0000000..80e0941
--- /dev/null
@@ -0,0 +1,7 @@
+#include <sys/types.h>
+#include <net.h>
+
+u_short ntohs(netshort) u_short netshort; {
+       write(2, "ntohs()\n", 8);
+       abort();
+}
index 7dc8baa..d35b25b 100644 (file)
@@ -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);
index f74f97d..1238698 100644 (file)
@@ -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;
        }
 }
index 5267cc1..0f0c8b5 100644 (file)
@@ -14,7 +14,10 @@ static char sccsid[] = "@(#)res_mkquery.c    6.3 (Berkeley) 3/17/86";
 #include <arpa/nameser.h>
 #include <resolv.h>
 
-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
index 4d28a20..8cdd9a2 100644 (file)
@@ -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
index a8fe781..39198ca 100644 (file)
@@ -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");
index 0b30e3f..ad8a2bd 100644 (file)
@@ -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;
 {
index eda3122..d28ab05 100644 (file)
@@ -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
index d5bbea7..0bd83ed 100644 (file)
@@ -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;
index e837cfd..331b111 100644 (file)
@@ -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 (file)
index 0000000..3aa00db
--- /dev/null
@@ -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 <sys/types.h>
+#include <varargs.h>
+#include <stdio.h>
+#include <ctype.h>
+
+/* 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);
+}
index 85fd7ad..ed2ec05 100644 (file)
@@ -3,7 +3,8 @@ static char sccsid[] = "@(#)doscan.c    5.2 (Berkeley) 3/9/86";
 #endif LIBC_SCCS and not lint
 
 #include <stdio.h>
-#include       <ctype.h>
+#include <ctype.h>
+#include <varargs.h>
 
 #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);
index 5c9e93d..07275b8 100644 (file)
@@ -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();
index f5dfac0..ca358bb 100644 (file)
@@ -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       <stdio.h>
+#include <stdio.h>
+#include <varargs.h>
 
-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);
 }
index b78d7d0..89c7cf8 100644 (file)
@@ -10,11 +10,12 @@ static char sccsid[] = "@(#)fread.c 5.2 (Berkeley) 3/9/86";
 
 #include       <stdio.h>
 
-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
 }
index aebd4f8..f50301b 100644 (file)
@@ -10,11 +10,12 @@ static char sccsid[] = "@(#)fwrite.c        5.2 (Berkeley) 3/9/86";
 
 #include       <stdio.h>
 
-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
 }
similarity index 96%
rename from lib/libc/gen/popen.c
rename to lib/libc/stdio/popen.c
index 69f3cb4..ecb31df 100644 (file)
@@ -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 <stdio.h>
 #include <signal.h>
@@ -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)];
index 2798278..7686d39 100644 (file)
@@ -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       <stdio.h>
+#include <stdio.h>
+#include <varargs.h>
 
-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);
 }
index 9f1cab6..7afbabd 100644 (file)
@@ -2,32 +2,53 @@
 static char sccsid[] = "@(#)scanf.c    5.2 (Berkeley) 3/9/86";
 #endif LIBC_SCCS and not lint
 
-#include       <stdio.h>
+#include <stdio.h>
+#include <varargs.h>
 
-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;
 }
index 7b3c1fc..b1c0379 100644 (file)
@@ -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;
index 6bbacce..3728531 100644 (file)
@@ -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       <stdio.h>
+#include <stdio.h>
+#include <varargs.h>
 
-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 (file)
index 0000000..08934ad
--- /dev/null
@@ -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 <stdio.h>
+#include <varargs.h>
+
+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 (file)
index 0000000..0db5729
--- /dev/null
@@ -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 <stdio.h>
+#include <varargs.h>
+
+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 (file)
index 0000000..f2a588d
--- /dev/null
@@ -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 <stdio.h>
+#include <varargs.h>
+
+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 (file)
index 0000000..c61a4ae
--- /dev/null
@@ -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 (file)
index 0000000..7f7bcc4
--- /dev/null
@@ -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 (file)
index 0000000..2725b7b
--- /dev/null
@@ -0,0 +1,6 @@
+#include <sys/socket.h>
+
+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 (file)
index 0000000..aecd4ad
--- /dev/null
@@ -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 (file)
index 0000000..bc07d5b
--- /dev/null
@@ -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 (file)
index 0000000..98b7570
--- /dev/null
@@ -0,0 +1,6 @@
+#include <sys/time.h>
+
+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 (file)
index 0000000..f263554
--- /dev/null
@@ -0,0 +1,6 @@
+#include <sys/socket.h>
+
+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 (file)
index 0000000..80f33fa
--- /dev/null
@@ -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 (file)
index 0000000..e00809c
--- /dev/null
@@ -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 (file)
index 0000000..1e5bf5c
--- /dev/null
@@ -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 (file)
index 0000000..d9e77fa
--- /dev/null
@@ -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 (file)
index 0000000..d5c0a19
--- /dev/null
@@ -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 (file)
index 0000000..1397e5e
--- /dev/null
@@ -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 (file)
index 0000000..472e908
--- /dev/null
@@ -0,0 +1,6 @@
+#include <sys/socket.h>
+
+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 (file)
index 0000000..63b90f4
--- /dev/null
@@ -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 (file)
index 0000000..7ec4eb5
--- /dev/null
@@ -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 (file)
index 0000000..f905bfd
--- /dev/null
@@ -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 (file)
index 0000000..c9742c5
--- /dev/null
@@ -0,0 +1,5 @@
+#include <varargs.h>
+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 (file)
index 0000000..f3105c3
--- /dev/null
@@ -0,0 +1,5 @@
+#include <varargs.h>
+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 (file)
index 0000000..86f3537
--- /dev/null
@@ -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 (file)
index 0000000..9728baf
--- /dev/null
@@ -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 (file)
index 0000000..963f235
--- /dev/null
@@ -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 (file)
index 0000000..8e4eb33
--- /dev/null
@@ -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 (file)
index 0000000..b41f83b
--- /dev/null
@@ -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 (file)
index 0000000..5cddbf3
--- /dev/null
@@ -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 (file)
index 0000000..8944c49
--- /dev/null
@@ -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 (file)
index 0000000..cc78532
--- /dev/null
@@ -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 (file)
index 0000000..9c7c4da
--- /dev/null
@@ -0,0 +1,6 @@
+#include <sys/stat.h>
+
+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 (file)
index 0000000..bf2cbce
--- /dev/null
@@ -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 (file)
index 0000000..eba2b44
--- /dev/null
@@ -0,0 +1,6 @@
+#include <sys/types.h>
+
+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 (file)
index 0000000..c1105d3
--- /dev/null
@@ -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 (file)
index 0000000..4603a9c
--- /dev/null
@@ -0,0 +1,6 @@
+#include <sys/types.h>
+
+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 (file)
index 0000000..32e1a47
--- /dev/null
@@ -0,0 +1,6 @@
+#include <sys/types.h>
+
+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 (file)
index 0000000..c0b2537
--- /dev/null
@@ -0,0 +1,6 @@
+#include <sys/types.h>
+
+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 (file)
index 0000000..aa44917
--- /dev/null
@@ -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 (file)
index 0000000..0c3ca43
--- /dev/null
@@ -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 (file)
index 0000000..787d7d9
--- /dev/null
@@ -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 (file)
index 0000000..7d0c1ac
--- /dev/null
@@ -0,0 +1,6 @@
+#include <sys/time.h>
+
+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 (file)
index 0000000..8506315
--- /dev/null
@@ -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 (file)
index 0000000..012153d
--- /dev/null
@@ -0,0 +1,6 @@
+#include <sys/socket.h>
+
+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 (file)
index 0000000..4719980
--- /dev/null
@@ -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 (file)
index 0000000..f1e1a5e
--- /dev/null
@@ -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 (file)
index 0000000..82c80c9
--- /dev/null
@@ -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 (file)
index 0000000..f788762
--- /dev/null
@@ -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 (file)
index 0000000..20ee251
--- /dev/null
@@ -0,0 +1,6 @@
+#include <sys/resource.h>
+
+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 (file)
index 0000000..9751a03
--- /dev/null
@@ -0,0 +1,6 @@
+#include <sys/resource.h>
+
+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 (file)
index 0000000..b90a597
--- /dev/null
@@ -0,0 +1,6 @@
+#include <sys/socket.h>
+
+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 (file)
index 0000000..a8b038f
--- /dev/null
@@ -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 (file)
index 0000000..de79c23
--- /dev/null
@@ -0,0 +1,6 @@
+#include <sys/time.h>
+
+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 (file)
index 0000000..13189af
--- /dev/null
@@ -0,0 +1,6 @@
+#include <sys/types.h>
+
+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 (file)
index 0000000..55f0d14
--- /dev/null
@@ -0,0 +1,6 @@
+#include <sys/types.h>
+
+int ioctl(d, r, p) u_long r; void *p; {
+       write(2, "ioctl()\n", 8);
+       abort();
+}
similarity index 85%
rename from lib/libc/gen/isatty.c
rename to lib/libc/sys/isatty.c
index 42eb42e..888a899 100644 (file)
@@ -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 <sgtty.h>
 
-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 (file)
index 0000000..bd5fbbc
--- /dev/null
@@ -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 (file)
index 0000000..7b5ffc4
--- /dev/null
@@ -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 (file)
index 0000000..cbf25e8
--- /dev/null
@@ -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 (file)
index 0000000..b762851
--- /dev/null
@@ -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 (file)
index 0000000..68839d6
--- /dev/null
@@ -0,0 +1,6 @@
+#include <sys/types.h>
+
+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 (file)
index 0000000..3d5411c
--- /dev/null
@@ -0,0 +1,6 @@
+#include <sys/stat.h>
+
+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 (file)
index 0000000..4c62724
--- /dev/null
@@ -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 (file)
index 0000000..23c78f3
--- /dev/null
@@ -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 (file)
index 0000000..c0a9ea0
--- /dev/null
@@ -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 (file)
index 0000000..92a5bb9
--- /dev/null
@@ -0,0 +1,11 @@
+#include <varargs.h>
+
+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 (file)
index 0000000..085ad2a
--- /dev/null
@@ -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 (file)
index 0000000..de3d355
--- /dev/null
@@ -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 (file)
index 0000000..4f73683
--- /dev/null
@@ -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 (file)
index 0000000..007e302
--- /dev/null
@@ -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 (file)
index 0000000..078cfd3
--- /dev/null
@@ -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 (file)
index 0000000..41416c8
--- /dev/null
@@ -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 (file)
index 0000000..fae61bb
--- /dev/null
@@ -0,0 +1,6 @@
+#include <sys/uio.h>
+
+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 (file)
index 0000000..4e757d7
--- /dev/null
@@ -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 (file)
index 0000000..3223282
--- /dev/null
@@ -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 (file)
index 0000000..d904feb
--- /dev/null
@@ -0,0 +1,6 @@
+#include <sys/socket.h>
+
+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 (file)
index 0000000..3e1e070
--- /dev/null
@@ -0,0 +1,6 @@
+#include <sys/socket.h>
+
+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 (file)
index 0000000..83f12cc
--- /dev/null
@@ -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 (file)
index 0000000..45719f0
--- /dev/null
@@ -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 (file)
index 0000000..457849f
--- /dev/null
@@ -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 (file)
index 0000000..7e58ab5
--- /dev/null
@@ -0,0 +1,7 @@
+#include <sys/time.h>
+#include <sys/types.h>
+
+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 (file)
index 0000000..b806ef3
--- /dev/null
@@ -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 (file)
index 0000000..c1b5ff8
--- /dev/null
@@ -0,0 +1,6 @@
+#include <sys/socket.h>
+
+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 (file)
index 0000000..33ebacb
--- /dev/null
@@ -0,0 +1,6 @@
+#include <sys/socket.h>
+
+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 (file)
index 0000000..0d8b166
--- /dev/null
@@ -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 (file)
index 0000000..13aa28d
--- /dev/null
@@ -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 (file)
index 0000000..15b9bf5
--- /dev/null
@@ -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 (file)
index 0000000..49ca8eb
--- /dev/null
@@ -0,0 +1,6 @@
+#include <sys/time.h>
+
+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 (file)
index 0000000..28806b2
--- /dev/null
@@ -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 (file)
index 0000000..6dfca6e
--- /dev/null
@@ -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 (file)
index 0000000..3182ebd
--- /dev/null
@@ -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 (file)
index 0000000..ef98c6c
--- /dev/null
@@ -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 (file)
index 0000000..5a26f5b
--- /dev/null
@@ -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 (file)
index 0000000..9d86780
--- /dev/null
@@ -0,0 +1,6 @@
+#include <sys/resource.h>
+
+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 (file)
index 0000000..0c6ddaa
--- /dev/null
@@ -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 (file)
index 0000000..32d99a5
--- /dev/null
@@ -0,0 +1,6 @@
+#include <sys/time.h>
+
+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 (file)
index 0000000..694be71
--- /dev/null
@@ -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 (file)
index 0000000..8994be1
--- /dev/null
@@ -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 (file)
index 0000000..ec4868a
--- /dev/null
@@ -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 (file)
index 0000000..0748888
--- /dev/null
@@ -0,0 +1,6 @@
+#include <sys/signal.h>
+
+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 (file)
index 0000000..bff2dd4
--- /dev/null
@@ -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 (file)
index 0000000..6f883f9
--- /dev/null
@@ -0,0 +1,6 @@
+#include <sys/signal.h>
+
+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 (file)
index 0000000..06c82f2
--- /dev/null
@@ -0,0 +1,6 @@
+#include <sys/signal.h>
+
+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 (file)
index 0000000..b69aace
--- /dev/null
@@ -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 (file)
index 0000000..cccd373
--- /dev/null
@@ -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 (file)
index 0000000..e21d30f
--- /dev/null
@@ -0,0 +1,6 @@
+#include <sys/stat.h>
+
+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 (file)
index 0000000..a22d0a5
--- /dev/null
@@ -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 (file)
index 0000000..2f9d5b3
--- /dev/null
@@ -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 (file)
index 0000000..c6197f6
--- /dev/null
@@ -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 (file)
index 0000000..f907e52
--- /dev/null
@@ -0,0 +1,6 @@
+#include <sys/types.h>
+
+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 (file)
index 0000000..0988c39
--- /dev/null
@@ -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 (file)
index 0000000..2ee58eb
--- /dev/null
@@ -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 (file)
index 0000000..5d4b138
--- /dev/null
@@ -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 (file)
index 0000000..a8e249a
--- /dev/null
@@ -0,0 +1,6 @@
+#include <sys/time.h>
+
+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 (file)
index 0000000..f5df786
--- /dev/null
@@ -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 (file)
index 0000000..8e7775e
--- /dev/null
@@ -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 (file)
index 0000000..dada99d
--- /dev/null
@@ -0,0 +1,6 @@
+#include <sys/file.h>
+#include <varargs.h>
+
+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 (file)
index 0000000..f3b66a1
--- /dev/null
@@ -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 (file)
index 0000000..202506b
--- /dev/null
@@ -0,0 +1,6 @@
+#include <sys/resource.h>
+
+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 (file)
index 0000000..24779ee
--- /dev/null
@@ -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 (file)
index 0000000..9b2998f
--- /dev/null
@@ -0,0 +1,6 @@
+#include <sys/uio.h>
+
+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 (executable)
index 46de732..0000000
+++ /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
index 31c143d..7d15698 100755 (executable)
@@ -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.patch
-sed -e 's/[\t ]\+/ /g;s/^ /void /;s/\* /*/g;s/( /(/g;s/ )/)/g' <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 <a >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.patch
+#sed -e 's/[\t ]\+/ /g;s/^ /void /;s/\* /*/g;s/( /(/g;s/ )/)/g' <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 <a >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/::' |\
index b4dcdbd..0e15209 100755 (executable)
 #!/bin/sh
-
-#sed -e 's/^/:/;s/ /::/g;s/$/:/' <conflicts.txt >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 <generated.txt
-
-find . -name '*.h' -print |\
-sed -e 's:^\./::' |\
-LC_ALL=C sort -r |\
-while read i
-do
-  echo "i=$i"
-  macros="`sed -ne 's/^#[       ]*define[       ]\+\([A-Za-z_][0-9A-Za-z_]*\).*/\1/p' $i.nocomm |grep -v '^NULL$'`"
-  echo "macros=$macros"
-  typedefs="`sed -ne 's/^\(.*[^0-9A-Za-z_]\)\?typedef[^0-9A-Za-z_]\(.*[^0-9A-Za-z_]\)\?\([A-Za-z_][0-9A-Za-z_]*\)[      ]*\(\[[         0-9]*\][        ]*\)\?;.*/\3/p' $i.nocomm; sed -ne 's/^}[       ]*\([A-Za-z_][0-9A-Za-z_]*\)[   ]*;.*/\1/p' $i.nocomm`"
-  echo "typedefs=$typedefs"
-  structs="`sed -ne 's/^\(.*[^0-9A-Za-z_]\)\?struct[    ]\+\([A-Za-z_][0-9A-Za-z_]*\)[  ]*{.*/\2/p' $i.nocomm`"
-  echo "structs=$structs"
-  unions="`sed -ne 's/^\(.*[^0-9A-Za-z_]\)\?union[      ]\+\([A-Za-z_][0-9A-Za-z_]*\)[  ]*{.*/\2/p' $i.nocomm`"
-  echo "unions=$unions"
-
-  rm -f $i.usedby
-
-  pattern=
-  prefix=
-  for j in $macros
-  do
-    pattern="$pattern$prefix$j"
-    prefix='\|'
-  done
-  for j in $typedefs
-  do
-    pattern="$pattern$prefix$j"
-    prefix='\|'
-  done
-  for j in $structs
-  do
-    pattern="$pattern${prefix}struct[   ]\\+$j"
-    prefix='\|'
-  done
-  for j in $unions
-  do
-    pattern="$pattern${prefix}union[    ]\\+$j"
-    prefix='\|'
-  done
-  echo "pattern=$pattern"
-
-  if test -n "$pattern"
-  then
-    grep -H "^\\(.*[^0-9A-Za-z_]\\)\\?\\($pattern\\)\\([^0-9A-Za-z_].*\\)\\?$" `cat generated.txt |sed -e 's/$/\.nocomm/'` >a
-    if test -s a
-    then
-      cat a >>$i.usedby
-      for j in `sed -e 's/\.nocomm:.*//' <a |sort |uniq`
-      do
-        echo "j=$j"
-        #if ! grep -q ":$i:.*:$j\\|:$j:.*:$i:" conflicts.temp && ! grep -q "^#include <$i>\$" $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 <generated.txt
-
-rm -rf ../libx_c.pre
-cp -r ../libx_c ../libx_c.pre
-patch --strip 1 <pre.patch
+#
+##sed -e 's/^/:/;s/ /::/g;s/$/:/' <conflicts.txt >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 <generated.txt
+#
+#find . -name '*.h' -print |\
+#sed -e 's:^\./::' |\
+#LC_ALL=C sort -r |\
+#while read i
+#do
+#  echo "i=$i"
+#  macros="`sed -ne 's/^#[      ]*define[       ]\+\([A-Za-z_][0-9A-Za-z_]*\).*/\1/p' $i.nocomm |grep -v '^NULL$'`"
+#  echo "macros=$macros"
+#  typedefs="`sed -ne 's/^\(.*[^0-9A-Za-z_]\)\?typedef[^0-9A-Za-z_]\(.*[^0-9A-Za-z_]\)\?\([A-Za-z_][0-9A-Za-z_]*\)[     ]*\(\[[         0-9]*\][        ]*\)\?;.*/\3/p' $i.nocomm; sed -ne 's/^}[       ]*\([A-Za-z_][0-9A-Za-z_]*\)[   ]*;.*/\1/p' $i.nocomm`"
+#  echo "typedefs=$typedefs"
+#  structs="`sed -ne 's/^\(.*[^0-9A-Za-z_]\)\?struct[   ]\+\([A-Za-z_][0-9A-Za-z_]*\)[  ]*{.*/\2/p' $i.nocomm`"
+#  echo "structs=$structs"
+#  unions="`sed -ne 's/^\(.*[^0-9A-Za-z_]\)\?union[     ]\+\([A-Za-z_][0-9A-Za-z_]*\)[  ]*{.*/\2/p' $i.nocomm`"
+#  echo "unions=$unions"
+#
+#  rm -f $i.usedby
+#
+#  pattern=
+#  prefix=
+#  for j in $macros
+#  do
+#    pattern="$pattern$prefix$j"
+#    prefix='\|'
+#  done
+#  for j in $typedefs
+#  do
+#    pattern="$pattern$prefix$j"
+#    prefix='\|'
+#  done
+#  for j in $structs
+#  do
+#    pattern="$pattern${prefix}struct[  ]\\+$j"
+#    prefix='\|'
+#  done
+#  for j in $unions
+#  do
+#    pattern="$pattern${prefix}union[   ]\\+$j"
+#    prefix='\|'
+#  done
+#  echo "pattern=$pattern"
+#
+#  if test -n "$pattern"
+#  then
+#    grep -H "^\\(.*[^0-9A-Za-z_]\\)\\?\\($pattern\\)\\([^0-9A-Za-z_].*\\)\\?$" `cat generated.txt |sed -e 's/$/\.nocomm/'` >a
+#    if test -s a
+#    then
+#      cat a >>$i.usedby
+#      for j in `sed -e 's/\.nocomm:.*//' <a |sort |uniq`
+#      do
+#        echo "j=$j"
+#        #if ! grep -q ":$i:.*:$j\\|:$j:.*:$i:" conflicts.temp && ! grep -q "^#include <$i>\$" $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 <generated.txt
+#
+#rm -rf ../libx_c.pre
+#cp -r ../libx_c ../libx_c.pre
+#patch --strip 1 <pre.patch
diff --git a/lib/libx_c/pre.patch b/lib/libx_c/pre.patch
deleted file mode 100644 (file)
index e452646..0000000
+++ /dev/null
@@ -1,2914 +0,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/compat-4.1/ftime.c libx_c/compat-4.1/ftime.c
---- libx_c.pre/compat-4.1/ftime.c      2017-01-23 12:53:13.671903803 +1100
-+++ libx_c/compat-4.1/ftime.c  2017-01-23 12:53:13.683903829 +1100
-@@ -10,18 +10,20 @@
- #include <sys/types.h>
- #include <sys/time.h>
-+#include <sys/timeb.h>
- /*
-  * 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 <sgtty.h>
- 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 <sgtty.h>
- 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 <sys/time.h>
- #include <sys/resource.h>
-+#include <sys/times.h>
- /*
-  * 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 <sys/time.h>
- #include <sys/resource.h>
-+#include <sys/vtimes.h>
- /*
-  * 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
-- * <sys/file.h>.  (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 <sys/file.h> */
--#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 <gen.h>
-+
- /*
-  * 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 <sgtty.h>
--
--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 <stdio.h>
--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 <stdio.h>
- #include <errno.h>
- #include <ndbm.h>
-+#include <varargs.h>
- #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 <stdio.h>
--#include <signal.h>
--
--#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 <gen.h>
-+
- /*
-  * 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 <signal.h>
--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 <sys/syslog.h>
- #include <netdb.h>
- #include <strings.h>
-+#include <varargs.h>
- #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 <netinet/in.h>
--#include <netns/ns.h>
- #include <sys/types.h>
-+#include <net.h>
- 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 <netinet/in.h>
--#include <netns/ns.h>
- #include <sys/types.h>
-+#include <net.h>
- 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 <netinet/in.h>
--#include <netns/ns.h>
- #include <sys/types.h>
-+#include <net.h>
- 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 <netinet/in.h>
--#include <netns/ns.h>
- #include <sys/types.h>
-+#include <net.h>
- 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 <arpa/nameser.h>
- #include <resolv.h>
--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 <a.out.h>
-- * 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 <stab.h> */
--      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 <stab.h>
-- */
--#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 <stdio.h>
--#include      <ctype.h>
-+#include <ctype.h>
-+#include <varargs.h>
- #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      <stdio.h>
-+#include <stdio.h>
-+#include <varargs.h>
--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      <stdio.h>
--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      <stdio.h>
--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 <stdio.h>
-+#include <signal.h>
-+
-+#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      <stdio.h>
-+#include <stdio.h>
-+#include <varargs.h>
--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      <stdio.h>
-+#include <stdio.h>
-+#include <varargs.h>
--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      <stdio.h>
-+#include <stdio.h>
-+#include <varargs.h>
--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 <stdio.h>
-+#include <varargs.h>
-+
-+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 <stdio.h>
-+#include <varargs.h>
-+
-+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 <stdio.h>
-+#include <varargs.h>
-+
-+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 <varargs.h>
-+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 <varargs.h>
-+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 <sgtty.h>
-+
-+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 <varargs.h>
- 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 <signal.h>
--#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 <signal.h>*/
-+/*#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 <sys/param.h>
-+
-+/* 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 <sys/file.h>
-+#include <varargs.h>
-+
-+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)))*/
index aaf362a..913a549 100644 (file)
@@ -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
 
index cf0fd68..275be9a 100644 (file)
@@ -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
index f7c5c2a..e02688c 100644 (file)
 /*
  * Signals
  */
-#ifdef KERNEL
-#include "signal.h"
-#else
-#include <signal.h>
-#endif
+/*#ifdef KERNEL*/
+/*#include "signal.h"*/
+/*#else*/
+/*#include <signal.h>*/
+/*#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 */
 
 /*
  * 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 */
index b81c5cb..5d069b0 100644 (file)
@@ -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 (file)
index 0000000..c861a51
--- /dev/null
@@ -0,0 +1,28 @@
+#include <sys/param.h>
+
+/* 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)))
index e08cebc..3242faf 100644 (file)
 #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
 
index 44e1d80..fe4ca20 100644 (file)
@@ -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
index db61842..37498ac 100644 (file)
@@ -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
index 99d965c..6581ea6 100644 (file)
@@ -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)))
index 4abef17..1921022 100644 (file)
@@ -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;
index 17d93e4..809778c 100644 (file)
@@ -81,7 +81,7 @@ struct        ip_timestamp {
                        struct in_addr ipt_addr;
                        n_long ipt_time;
                } ipt_ta[1];
-       }
+       };
 };
 
 /* flag bits for ipt_flg */
index 3f2f4d3..8409c43 100644 (file)
@@ -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
 
 /*
index 63b8a86..5fdf1e7 100644 (file)
@@ -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;
index ed0f50e..a17cf61 100644 (file)
 /*
  * 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)))*/