Significant progress on getting libstdc to compile, fixed various missing or lax...
authorNick Downing <downing.nick@gmail.com>
Thu, 19 Jan 2017 04:37:41 +0000 (15:37 +1100)
committerNick Downing <downing.nick@gmail.com>
Thu, 19 Jan 2017 04:40:22 +0000 (15:40 +1100)
194 files changed:
cproto-4.6/grammar.y
cproto-4.6/lex.l
lib/libstdc/assert.h
lib/libstdc/compat-4.1.h
lib/libstdc/compat-4.1/ftime.c
lib/libstdc/compat-4.1/getpw.c
lib/libstdc/compat-4.1/gtty.c
lib/libstdc/compat-4.1/nice.c
lib/libstdc/compat-4.1/stty.c
lib/libstdc/compat-4.1/times.c
lib/libstdc/compat-4.1/utime.c
lib/libstdc/compat-4.1/vlimit.c
lib/libstdc/compat-4.1/vtimes.c
lib/libstdc/compat-sys5/getopt.c
lib/libstdc/conflicts.txt
lib/libstdc/csu.h [deleted file]
lib/libstdc/csu/crt0.c [deleted file]
lib/libstdc/csu/gmon.c [deleted file]
lib/libstdc/csu/mon.c [deleted file]
lib/libstdc/errfunc.sh [new file with mode: 0755]
lib/libstdc/gen.h
lib/libstdc/gen/alarm.c
lib/libstdc/gen/closedir.c
lib/libstdc/gen/ctime.c
lib/libstdc/gen/ctype_.c
lib/libstdc/gen/disktab.c
lib/libstdc/gen/execvp.c
lib/libstdc/gen/fakcu.c
lib/libstdc/gen/fstab.c
lib/libstdc/gen/getgrent.c
lib/libstdc/gen/getgrgid.c
lib/libstdc/gen/getgrnam.c
lib/libstdc/gen/getlogin.c
lib/libstdc/gen/getpass.c
lib/libstdc/gen/getpwent.c
lib/libstdc/gen/getpwnamuid.c
lib/libstdc/gen/getttyent.c
lib/libstdc/gen/getttynam.c
lib/libstdc/gen/getusershell.c
lib/libstdc/gen/getwd.c
lib/libstdc/gen/initgroups.c
lib/libstdc/gen/insque.c
lib/libstdc/gen/malloc.c
lib/libstdc/gen/mkstemp.c
lib/libstdc/gen/ndbm.c
lib/libstdc/gen/nlist.c
lib/libstdc/gen/opendir.c
lib/libstdc/gen/perror.c
lib/libstdc/gen/psignal.c
lib/libstdc/gen/qsort.c
lib/libstdc/gen/random.c
lib/libstdc/gen/readdir.c
lib/libstdc/gen/remque.c
lib/libstdc/gen/scandir.c
lib/libstdc/gen/seekdir.c
lib/libstdc/gen/siginterrupt.c
lib/libstdc/gen/siglist.c
lib/libstdc/gen/signal.c
lib/libstdc/gen/sleep.c
lib/libstdc/gen/syslog.c
lib/libstdc/gen/system.c
lib/libstdc/gen/telldir.c
lib/libstdc/gen/time.c
lib/libstdc/gen/ttyname.c
lib/libstdc/gen/ttyslot.c
lib/libstdc/gen/ualarm.c
lib/libstdc/gen/usleep.c
lib/libstdc/groups.txt
lib/libstdc/inet/inet_addr.c
lib/libstdc/inet/inet_lnaof.c
lib/libstdc/inet/inet_makeaddr.c
lib/libstdc/inet/inet_netof.c
lib/libstdc/inet/inet_network.c
lib/libstdc/inet/inet_ntoa.c
lib/libstdc/libstdc.patch
lib/libstdc/mkpatch.sh [new file with mode: 0755]
lib/libstdc/mp.h [deleted file]
lib/libstdc/n.sh
lib/libstdc/net.h
lib/libstdc/net/getnetbyaddr.c
lib/libstdc/net/getnetbyname.c
lib/libstdc/net/getnetent.c
lib/libstdc/net/getproto.c
lib/libstdc/net/getprotoent.c
lib/libstdc/net/getprotoname.c
lib/libstdc/net/getservbyname.c
lib/libstdc/net/getservbyport.c
lib/libstdc/net/getservent.c
lib/libstdc/net/hosttable/gethostent.c
lib/libstdc/net/hosttable/gethostnamadr.c
lib/libstdc/net/htonl.c
lib/libstdc/net/htons.c
lib/libstdc/net/named/gethostnamadr.c
lib/libstdc/net/named/sethostent.c
lib/libstdc/net/ntohl.c
lib/libstdc/net/ntohs.c
lib/libstdc/net/rcmd.c
lib/libstdc/net/res_comp.c
lib/libstdc/net/res_debug.c
lib/libstdc/net/res_init.c
lib/libstdc/net/res_mkquery.c
lib/libstdc/net/res_send.c
lib/libstdc/net/rexec.c
lib/libstdc/net/ruserpass.c
lib/libstdc/netinet/if_ether.h
lib/libstdc/netinet/in_pcb.h
lib/libstdc/netinet/tcp_debug.h
lib/libstdc/netns/ns_pcb.h
lib/libstdc/ns/ns_addr.c
lib/libstdc/ns/ns_ntoa.c
lib/libstdc/oldprotos.txt
lib/libstdc/r.sh
lib/libstdc/s.sh
lib/libstdc/stdio.h
lib/libstdc/stdio/clrerr.c
lib/libstdc/stdio/doprnt.c
lib/libstdc/stdio/doscan.c
lib/libstdc/stdio/exit.c
lib/libstdc/stdio/fdopen.c
lib/libstdc/stdio/fgetc.c
lib/libstdc/stdio/fgets.c
lib/libstdc/stdio/filbuf.c
lib/libstdc/stdio/findiop.c
lib/libstdc/stdio/flsbuf.c
lib/libstdc/stdio/fopen.c
lib/libstdc/stdio/fprintf.c
lib/libstdc/stdio/fputc.c
lib/libstdc/stdio/fputs.c
lib/libstdc/stdio/fread.c
lib/libstdc/stdio/freopen.c
lib/libstdc/stdio/fseek.c
lib/libstdc/stdio/ftell.c
lib/libstdc/stdio/fwrite.c
lib/libstdc/stdio/getchar.c
lib/libstdc/stdio/gets.c
lib/libstdc/stdio/getw.c
lib/libstdc/stdio/popen.c
lib/libstdc/stdio/printf.c
lib/libstdc/stdio/putchar.c
lib/libstdc/stdio/puts.c
lib/libstdc/stdio/putw.c
lib/libstdc/stdio/rew.c
lib/libstdc/stdio/scanf.c
lib/libstdc/stdio/setbuf.c
lib/libstdc/stdio/setbuffer.c
lib/libstdc/stdio/sibuf.c
lib/libstdc/stdio/sobuf.c
lib/libstdc/stdio/sprintf.c
lib/libstdc/stdio/strout.c
lib/libstdc/stdio/ungetc.c
lib/libstdc/stdio/vfprintf.c
lib/libstdc/stdio/vprintf.c
lib/libstdc/stdio/vsprintf.c
lib/libstdc/sys/ioctl.h
lib/libstdc/sys/isatty.c [moved from lib/libstdc/gen/isatty.c with 92% similarity]
lib/libstdc/sys/namei.h
lib/libstdc/sys/param.h
lib/libstdc/sys/proc.h
lib/libstdc/sys/syslog.h
lib/libstdc/sys/tablet.h
lib/libstdc/sys/time.h
lib/libstdc/sys/tty.h
lib/libstdc/sys/user.h
lib/libstdc/sys/vcmd.h
lib/libstdc/sys/vfork.c [new file with mode: 0644]
lib/libstdc/unported.txt
lib/libstdc/vaxuba/rxreg.h
x_include/netinet/x_if_ether.h
x_include/netinet/x_in_pcb.h
x_include/netinet/x_tcp_debug.h
x_include/netns/x_ns_pcb.h
x_include/sys/x_ioctl.h
x_include/sys/x_kernel.h
x_include/sys/x_namei.h
x_include/sys/x_param.h
x_include/sys/x_proc.h
x_include/sys/x_syslog.h
x_include/sys/x_tablet.h
x_include/sys/x_time.h
x_include/sys/x_tty.h
x_include/sys/x_user.h
x_include/sys/x_vcmd.h
x_include/vaxuba/x_rxreg.h
x_include/x_.h
x_include/x_assert.h
x_include/x_compat-4.1.h
x_include/x_csu.h [deleted file]
x_include/x_gen.h
x_include/x_mp.h [deleted file]
x_include/x_net.h
x_include/x_stdio.h
xify/x_.h
xify/xify.c
xify/xify.sh [new file with mode: 0755]

index 8ed8f51..f4511d2 100644 (file)
@@ -258,6 +258,7 @@ declarator_list
             */
            if (strcmp($1->text, $1->name) != 0)
                flags &= ~(DS_CHAR | DS_SHORT | DS_FLOAT);
+ /*fprintf(stderr, "typedef: %s\n", $1->name);*/
            new_symbol(typedef_names, $1->name, NULL, flags);
            free_declarator($1);
        }
@@ -267,6 +268,7 @@ declarator_list
 
            if (strcmp($3->text, $3->name) != 0)
                flags &= ~(DS_CHAR | DS_SHORT | DS_FLOAT);
+ /*fprintf(stderr, "typedef: %s\n", $3->name);*/
            new_symbol(typedef_names, $3->name, NULL, flags);
            free_declarator($3);
        }
index 8a55787..71513e4 100644 (file)
@@ -963,13 +963,16 @@ char *file_spec;  /* path surrounded by "" or <> */
     file[n] = '\0';
  /*fprintf(stderr, "request %s\n", file);*/
 
+#if 0 /* Nick */
     /* Do nothing if the file was already included. */
     sprintf(path, stdinc ? "<%s>" : "\"%s\"", file);
     if (find_symbol(included_files, path) != NULL)
        return;
     new_symbol(included_files, path, NULL, DS_NONE);
+#endif
 
 #if 1 /* Nick */
+ /*fprintf(stderr, "entry cur_file: %s\n", cur_file->file_name);*/
  int j = strlen(cur_file->file_name);
  while (j >= 0 && cur_file->file_name[j--] != '/')
   ;
@@ -983,12 +986,40 @@ char *file_spec;  /* path surrounded by "" or <> */
        } else {
            sprintf(path, "%s/%s", inc_dir[i], file);
        }
+#if 1 /* Nick */
+ /*fprintf(stderr, "path before: %s\n", path);*/
+ char *stack[MAX_TEXT_SIZE/2];
+ int level = 0;
+ char *p = path, *q = path;
+ stack[level++] = q;
+ while ((*q++ = *p++) != 0)
+  if (q[-1] == '/') {
+   if (stack[level - 1] == q - 1 || (stack[level - 1] == q - 2 && q[-2] == '.'))
+    q = stack[level - 1];
+   else if (level >= 2 && stack[level - 1] == q - 3 && q[-3] == '.' && q[-2] == '.')
+    q = stack[--level - 1];
+   else
+    stack[level++] = q;
+  }
+ /*fprintf(stderr, "path after: %s\n", path);*/
+ if (find_symbol(included_files, path) != NULL) {
+  /*fprintf(stderr, "already included %s\n", path);*/
+  cur_file->file_name[j] = c;
+  inc_dir[0] = "";
+  /*fprintf(stderr, "exit cur_file: %s\n", cur_file->file_name);*/
+  return;
+ }
+#endif
  /*fprintf(stderr, "trying %s\n", path);*/
        if ((fp = fopen(path, "r")) != NULL) {
  /*fprintf(stderr, "success!\n");*/
 #if 1 /* Nick */
  cur_file->file_name[j] = c;
  inc_dir[0] = "";
+#endif
+#if 1 /* Nick */
+ /*fprintf(stderr, "including %s\n", path);*/
+ new_symbol(included_files, path, NULL, DS_NONE);
 #endif
            yyin = fp;
            include_file(path, func_style != FUNC_NONE && !stdinc);
@@ -1005,6 +1036,7 @@ char *file_spec;  /* path surrounded by "" or <> */
        put_error();
        fprintf(stderr, "cannot read file %s\n", file_spec);
     }
+ /*fprintf(stderr, "exit cur_file: %s\n", cur_file->file_name);*/
 }
 
 /* When the end of the current input file is reached, pop a
index 35a6e88..89072b1 100644 (file)
@@ -1,7 +1,6 @@
 #ifndef _ASSERT_H_
 #define _ASSERT_H_
 
-#include <csu.h>
 #include <stdio.h>
 
 /*     assert.h        4.2     85/01/21        */
index 1cdb38d..dac9dd4 100644 (file)
@@ -3,8 +3,8 @@
 
 #include <sys/ioctl.h>
 #include <sys/resource.h>
-#include <sys/timeb.h>
 #include <sys/time.h>
+#include <sys/timeb.h>
 #include <sys/times.h>
 #include <sys/vlimit.h>
 #include <sys/vtimes.h>
index 3d48a09..87c49e1 100644 (file)
@@ -1,6 +1,5 @@
-#include <sys/timeb.h>
 #include <sys/time.h>
-#include <sys/types.h>
+#include <sys/timeb.h>
 
 /*
  * Copyright (c) 1980 Regents of the University of California.
 static char sccsid[] = "@(#)ftime.c    5.2 (Berkeley) 3/9/86";
 #endif
 
-#include <sys/types.h>
-#include <sys/time.h>
+/*#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;*/
+/*};*/
 
 int ftime(tp) register struct timeb *tp; {
        struct timeval t;
index a8e8191..e8f29d8 100644 (file)
@@ -11,7 +11,7 @@
 static char sccsid[] = "@(#)getpw.c    5.2 (Berkeley) 3/9/86";
 #endif
 
-#include       <stdio.h>
+/*#include     <stdio.h>*/
 
 int getpw(uid, buf) int uid; char buf[]; {
        static FILE *pwf;
index 4819cc5..0793068 100644 (file)
@@ -14,7 +14,7 @@ static char sccsid[] = "@(#)gtty.c    5.2 (Berkeley) 3/9/86";
  * Writearound to old gtty system call.
  */
 
-#include <sgtty.h>
+/*#include <sgtty.h>*/
 
 int gtty(fd, ap) int fd; struct sgttyb *ap; {
 
index bc2978b..20b16d9 100644 (file)
@@ -10,8 +10,8 @@
 static char sccsid[] = "@(#)nice.c     5.2 (Berkeley) 3/9/86";
 #endif
 
-#include <sys/time.h>
-#include <sys/resource.h>
+/*#include <sys/time.h>*/
+/*#include <sys/resource.h>*/
 
 /*
  * Backwards compatible nice.
index a4951e0..dabc3f2 100644 (file)
@@ -14,7 +14,7 @@ static char sccsid[] = "@(#)stty.c    5.2 (Berkeley) 3/9/86";
  * Writearound to old stty system call.
  */
 
-#include <sgtty.h>
+/*#include <sgtty.h>*/
 
 int stty(fd, ap) int fd; struct sgttyb *ap; {
 
index fb363b0..78d89ed 100644 (file)
@@ -12,8 +12,8 @@
 static char sccsid[] = "@(#)times.c    5.2 (Berkeley) 3/9/86";
 #endif
 
-#include <sys/time.h>
-#include <sys/resource.h>
+/*#include <sys/time.h>*/
+/*#include <sys/resource.h>*/
 
 /*
  * Backwards compatible times.
index 1e2c122..8f80564 100644 (file)
@@ -10,7 +10,7 @@
 static char sccsid[] = "@(#)utime.c    5.2 (Berkeley) 3/9/86";
 #endif
 
-#include <sys/time.h>
+/*#include <sys/time.h>*/
 /*
  * Backwards compatible utime.
  */
index 0361294..52aafa3 100644 (file)
@@ -15,9 +15,9 @@ static char sccsid[] = "@(#)vlimit.c  5.2 (Berkeley) 3/9/86";
 /*
  * (Almost) backwards compatible vlimit.
  */
-#include <sys/time.h>
-#include <sys/resource.h>
-#include <errno.h>
+/*#include <sys/time.h>*/
+/*#include <sys/resource.h>*/
+/*#include <errno.h>*/
 
 /* LIM_NORAISE is not emulated */
 #define        LIM_NORAISE     0       /* if <> 0, can't raise limits */
index 37c5113..f9e53db 100644 (file)
 static char sccsid[] = "@(#)vtimes.c   5.2 (Berkeley) 3/9/86";
 #endif
 
-#include <sys/time.h>
-#include <sys/resource.h>
+/*#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 */
+/*};*/
 
 static getvtimes __P((register struct rusage *aru, register struct vtimes *avt));
 static scale60 __P((register struct timeval *tvp));
index 3f4949e..d671494 100644 (file)
@@ -12,7 +12,7 @@
 static char sccsid[] = "@(#)getopt.c   4.3 (Berkeley) 3/9/86";
 #endif
 
-#include <stdio.h>
+/*#include <stdio.h>*/
 
 /*
  * get option letter from argument vector
index 92e9906..7e4415f 100644 (file)
@@ -3,7 +3,9 @@ arpa/telnet.h gen/crypt.c net/ruserpass.c
 compat-4.1.h compat-sys5/getopt.c
 csu/gmon.c csu/mon.c sys/gprof.h
 ctype.h vaxuba/vsreg.h
-gen.h gen/insque.c gen/remque.c sys/systm.h
+gen.h sys/systm.h
+gen/insque.c sys/systm.h
+gen/remque.c sys/systm.h
 gen/regex.c sys/ttychars.h
 netinet/in.h netns/ns.h
 netinet/in_var.h netns/ns_if.h
diff --git a/lib/libstdc/csu.h b/lib/libstdc/csu.h
deleted file mode 100644 (file)
index 05596fb..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-#ifndef _CSU_H_
-#define _CSU_H_
-
-#ifndef KERNEL
-#ifndef __P
-#ifdef __STDC__
-#define __P(args) args
-#else
-#define __P(args) ()
-#endif
-#endif
-
-/* csu/crt0.c */
-int start __P((void));
-int exit __P((register int code));
-int moncontrol __P((int val));
-
-/* csu/gmon.c */
-int monstartup __P((char *lowpc, char *highpc));
-int _mcleanup __P((void));
-int mcount __P((void));
-int monitor __P((char *lowpc, char *highpc, char *buf, int bufsiz, int nfunc));
-int moncontrol __P((int mode));
-
-/* csu/mon.c */
-int monstartup __P((char *lowpc, char *highpc));
-int mcount __P((void));
-int monitor __P((char *lowpc, char *highpc, char *buf, int bufsiz, int cntsiz));
-int moncontrol __P((int mode));
-#endif
-
-#endif
diff --git a/lib/libstdc/csu/crt0.c b/lib/libstdc/csu/crt0.c
deleted file mode 100644 (file)
index 6663ce0..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-#include <csu.h>
-#include <gen.h>
-#include <stdio.h>
-#include <sys/file.h>
-
-/*
- * 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[] = "@(#)crt0.c     5.3 (Berkeley) 3/9/86";
-#endif
-
-/*
- *     C start up routine.
- *     Robert Henry, UCB, 20 Oct 81
- *
- *     We make the following (true) assumptions:
- *     1) when the kernel calls start, it does a jump to location 2,
- *     and thus avoids the register save mask.  We are NOT called
- *     with a calls!  see sys1.c:setregs().
- *     2) The only register variable that we can trust is sp,
- *     which points to the base of the kernel calling frame.
- *     Do NOT believe the documentation in exec(2) regarding the
- *     values of fp and ap.
- *     3) We can allocate as many register variables as we want,
- *     and don't have to save them for anybody.
- *     4) Because of the ways that asm's work, we can't have
- *     any automatic variables allocated on the stack, because
- *     we must catch the value of sp before any automatics are
- *     allocated.
- */
-
-char **environ = (char **)0;
-static int fd;
-
-asm("#define _start start");
-asm("#define _eprol eprol");
-extern unsigned char   etext;
-extern unsigned char   eprol;
-int start() {
-       struct kframe {
-               int     kargc;
-               char    *kargv[1];      /* size depends on kargc */
-               char    kargstr[1];     /* size varies */
-               char    kenvstr[1];     /* size varies */
-       };
-       /*
-        *      ALL REGISTER VARIABLES!!!
-        */
-       register int r11;               /* needed for init */
-       register struct kframe *kfp;    /* r10 */
-       register char **targv;
-       register char **argv;
-       extern int errno;
-
-#ifdef lint
-       kfp = 0;
-       initcode = initcode = 0;
-#else
-       asm("   movl    sp,r10");       /* catch it quick */
-#endif
-       for (argv = targv = &kfp->kargv[0]; *targv++; /* void */)
-               /* void */ ;
-       if (targv >= (char **)(*argv))
-               --targv;
-       environ = targv;
-asm("eprol:");
-
-#ifdef paranoid
-       /*
-        * The standard I/O library assumes that file descriptors 0, 1, and 2
-        * are open. If one of these descriptors is closed prior to the start 
-        * of the process, I/O gets very confused. To avoid this problem, we
-        * insure that the first three file descriptors are open before calling
-        * main(). Normally this is undefined, as it adds two unnecessary
-        * system calls.
-        */
-       do      {
-               fd = open("/dev/null", 2);
-       } while (fd >= 0 && fd < 3);
-       close(fd);
-#endif
-
-#ifdef MCRT0
-       monstartup(&eprol, &etext);
-#endif
-       errno = 0;
-       exit(main(kfp->kargc, argv, environ));
-}
-asm("#undef _start");
-asm("#undef _eprol");
-
-#ifdef MCRT0
-/*ARGSUSED*/
-int exit(code) register int code;      /* r11 */ {
-       monitor(0);
-       _cleanup();
-       asm("   movl r11,r0");
-       asm("   chmk $1");
-}
-#endif
-
-#ifdef CRT0
-/*
- * null mcount and moncontrol,
- * just in case some routine is compiled for profiling
- */
-int moncontrol(val) int val; {
-
-}
-asm("  .globl  mcount");
-asm("mcount:   rsb");
-#endif
diff --git a/lib/libstdc/csu/gmon.c b/lib/libstdc/csu/gmon.c
deleted file mode 100644 (file)
index b076d0a..0000000
+++ /dev/null
@@ -1,291 +0,0 @@
-#include <csu.h>
-#include <stdio.h>
-#include <sys/errno.h>
-#include <sys/file.h>
-#include <sys.h>
-#include <sys/proc.h>
-
-/*
- * 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[] = "@(#)gmon.c     5.3 (Berkeley) 3/9/86";
-#endif
-
-#ifdef DEBUG
-#include <stdio.h>
-#endif
-
-#include "gmon.h"
-
-    /*
-     * froms is actually a bunch of unsigned shorts indexing tos
-     */
-static int             profiling = 3;
-static unsigned short  *froms;
-static struct tostruct *tos = 0;
-static long            tolimit = 0;
-static char            *s_lowpc = 0;
-static char            *s_highpc = 0;
-static unsigned long   s_textsize = 0;
-
-static int     ssiz;
-static char    *sbuf;
-static int     s_scale;
-    /* see profil(2) where this is describe (incorrectly) */
-#define                SCALE_1_TO_1    0x10000L
-
-#define        MSG "No space for monitor buffer(s)\n"
-
-int monstartup(lowpc, highpc) char *lowpc; char *highpc; {
-    int                        monsize;
-    char               *buffer;
-    char               *sbrk();
-    extern char                *minbrk;
-
-       /*
-        *      round lowpc and highpc to multiples of the density we're using
-        *      so the rest of the scaling (here and in gprof) stays in ints.
-        */
-    lowpc = (char *)
-           ROUNDDOWN((unsigned)lowpc, HISTFRACTION*sizeof(HISTCOUNTER));
-    s_lowpc = lowpc;
-    highpc = (char *)
-           ROUNDUP((unsigned)highpc, HISTFRACTION*sizeof(HISTCOUNTER));
-    s_highpc = highpc;
-    s_textsize = highpc - lowpc;
-    monsize = (s_textsize / HISTFRACTION) + sizeof(struct phdr);
-    buffer = sbrk( monsize );
-    if ( buffer == (char *) -1 ) {
-       write( 2 , MSG , sizeof(MSG) );
-       return;
-    }
-    froms = (unsigned short *) sbrk( s_textsize / HASHFRACTION );
-    if ( froms == (unsigned short *) -1 ) {
-       write( 2 , MSG , sizeof(MSG) );
-       froms = 0;
-       return;
-    }
-    tolimit = s_textsize * ARCDENSITY / 100;
-    if ( tolimit < MINARCS ) {
-       tolimit = MINARCS;
-    } else if ( tolimit > 65534 ) {
-       tolimit = 65534;
-    }
-    tos = (struct tostruct *) sbrk( tolimit * sizeof( struct tostruct ) );
-    if ( tos == (struct tostruct *) -1 ) {
-       write( 2 , MSG , sizeof(MSG) );
-       froms = 0;
-       tos = 0;
-       return;
-    }
-    minbrk = sbrk(0);
-    tos[0].link = 0;
-    monitor( lowpc , highpc , buffer , monsize , tolimit );
-}
-
-int _mcleanup() {
-    int                        fd;
-    int                        fromindex;
-    int                        endfrom;
-    char               *frompc;
-    int                        toindex;
-    struct rawarc      rawarc;
-
-    fd = creat( "gmon.out" , 0666 );
-    if ( fd < 0 ) {
-       perror( "mcount: gmon.out" );
-       return;
-    }
-#   ifdef DEBUG
-       fprintf( stderr , "[mcleanup] sbuf 0x%x ssiz %d\n" , sbuf , ssiz );
-#   endif
-    write( fd , sbuf , ssiz );
-    endfrom = s_textsize / (HASHFRACTION * sizeof(*froms));
-    for ( fromindex = 0 ; fromindex < endfrom ; fromindex++ ) {
-       if ( froms[fromindex] == 0 ) {
-           continue;
-       }
-       frompc = s_lowpc + (fromindex * HASHFRACTION * sizeof(*froms));
-       for (toindex=froms[fromindex]; toindex!=0; toindex=tos[toindex].link) {
-#          ifdef DEBUG
-               fprintf( stderr ,
-                       "[mcleanup] frompc 0x%x selfpc 0x%x count %d\n" ,
-                       frompc , tos[toindex].selfpc , tos[toindex].count );
-#          endif
-           rawarc.raw_frompc = (unsigned long) frompc;
-           rawarc.raw_selfpc = (unsigned long) tos[toindex].selfpc;
-           rawarc.raw_count = tos[toindex].count;
-           write( fd , &rawarc , sizeof rawarc );
-       }
-    }
-    close( fd );
-}
-
-asm(".text");
-asm(".align 2");
-asm("#the beginning of mcount()");
-asm(".data");
-int mcount() {
-       register char                   *selfpc;        /* r11 => r5 */
-       register unsigned short         *frompcindex;   /* r10 => r4 */
-       register struct tostruct        *top;           /* r9  => r3 */
-       register struct tostruct        *prevtop;       /* r8  => r2 */
-       register long                   toindex;        /* r7  => r1 */
-
-       /*
-        *      find the return address for mcount,
-        *      and the return address for mcount's caller.
-        */
-       asm("   .text");                /* make sure we're in text space */
-       asm("   movl (sp), r11");       /* selfpc = ... (jsb frame) */
-       asm("   movl 16(fp), r10");     /* frompcindex =     (calls frame) */
-       /*
-        *      check that we are profiling
-        *      and that we aren't recursively invoked.
-        */
-       if (profiling) {
-               goto out;
-       }
-       profiling++;
-       /*
-        *      check that frompcindex is a reasonable pc value.
-        *      for example:    signal catchers get called from the stack,
-        *                      not from text space.  too bad.
-        */
-       frompcindex = (unsigned short *)((long)frompcindex - (long)s_lowpc);
-       if ((unsigned long)frompcindex > s_textsize) {
-               goto done;
-       }
-       frompcindex =
-           &froms[((long)frompcindex) / (HASHFRACTION * sizeof(*froms))];
-       toindex = *frompcindex;
-       if (toindex == 0) {
-               /*
-                *      first time traversing this arc
-                */
-               toindex = ++tos[0].link;
-               if (toindex >= tolimit) {
-                       goto overflow;
-               }
-               *frompcindex = toindex;
-               top = &tos[toindex];
-               top->selfpc = selfpc;
-               top->count = 1;
-               top->link = 0;
-               goto done;
-       }
-       top = &tos[toindex];
-       if (top->selfpc == selfpc) {
-               /*
-                *      arc at front of chain; usual case.
-                */
-               top->count++;
-               goto done;
-       }
-       /*
-        *      have to go looking down chain for it.
-        *      top points to what we are looking at,
-        *      prevtop points to previous top.
-        *      we know it is not at the head of the chain.
-        */
-       for (; /* goto done */; ) {
-               if (top->link == 0) {
-                       /*
-                        *      top is end of the chain and none of the chain
-                        *      had top->selfpc == selfpc.
-                        *      so we allocate a new tostruct
-                        *      and link it to the head of the chain.
-                        */
-                       toindex = ++tos[0].link;
-                       if (toindex >= tolimit) {
-                               goto overflow;
-                       }
-                       top = &tos[toindex];
-                       top->selfpc = selfpc;
-                       top->count = 1;
-                       top->link = *frompcindex;
-                       *frompcindex = toindex;
-                       goto done;
-               }
-               /*
-                *      otherwise, check the next arc on the chain.
-                */
-               prevtop = top;
-               top = &tos[top->link];
-               if (top->selfpc == selfpc) {
-                       /*
-                        *      there it is.
-                        *      increment its count
-                        *      move it to the head of the chain.
-                        */
-                       top->count++;
-                       toindex = prevtop->link;
-                       prevtop->link = top->link;
-                       top->link = *frompcindex;
-                       *frompcindex = toindex;
-                       goto done;
-               }
-
-       }
-done:
-       profiling--;
-       /* and fall through */
-out:
-       asm("   rsb");
-
-overflow:
-       profiling++; /* halt further profiling */
-#   define     TOLIMIT "mcount: tos overflow\n"
-       write(2, TOLIMIT, sizeof(TOLIMIT));
-       goto out;
-}
-asm(".text");
-asm("#the end of mcount()");
-asm(".data");
-
-/*VARARGS1*/
-int monitor(lowpc, highpc, buf, bufsiz, nfunc) char *lowpc; char *highpc; char *buf;   /* declared ``short buffer[]'' in monitor(3) */ int bufsiz; int nfunc;  /* not used, available for compatability only */ {
-    register o;
-
-    if ( lowpc == 0 ) {
-       moncontrol(0);
-       _mcleanup();
-       return;
-    }
-    sbuf = buf;
-    ssiz = bufsiz;
-    ( (struct phdr *) buf ) -> lpc = lowpc;
-    ( (struct phdr *) buf ) -> hpc = highpc;
-    ( (struct phdr *) buf ) -> ncnt = ssiz;
-    bufsiz -= sizeof(struct phdr);
-    if ( bufsiz <= 0 )
-       return;
-    o = highpc - lowpc;
-    if( bufsiz < o )
-       s_scale = ( (float) bufsiz / o ) * SCALE_1_TO_1;
-    else
-       s_scale = SCALE_1_TO_1;
-    moncontrol(1);
-}
-
-/*
- * Control profiling
- *     profiling is what mcount checks to see if
- *     all the data structures are ready.
- */
-int moncontrol(mode) int mode; {
-    if (mode) {
-       /* start */
-       profil(sbuf + sizeof(struct phdr), ssiz - sizeof(struct phdr),
-               s_lowpc, s_scale);
-       profiling = 0;
-    } else {
-       /* stop */
-       profil((char *)0, 0, 0, 0);
-       profiling = 3;
-    }
-}
diff --git a/lib/libstdc/csu/mon.c b/lib/libstdc/csu/mon.c
deleted file mode 100644 (file)
index 1b8263f..0000000
+++ /dev/null
@@ -1,166 +0,0 @@
-#include <csu.h>
-#include <sys/file.h>
-#include <sys.h>
-#include <sys/proc.h>
-
-/*
- * 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[] = "@(#)mon.c      5.3 (Berkeley) 3/9/86";
-#endif
-
-#define ARCDENSITY     5       /* density of routines */
-#define MINARCS                50      /* minimum number of counters */
-#define        HISTFRACTION    2       /* fraction of text space for histograms */
-
-struct phdr {
-       int *lpc;
-       int *hpc;
-       int ncnt;
-};
-
-struct cnt {
-       int *pc;
-       long ncall;
-} *countbase;
-
-static int cntrs = 0;
-static int profiling = 3;
-static char *s_sbuf;
-static int s_bufsiz;
-static int s_scale;
-static char *s_lowpc;
-
-int numctrs;
-
-#define        MSG "No space for monitor buffer(s)\n"
-
-int monstartup(lowpc, highpc) char *lowpc; char *highpc; {
-       int monsize;
-       char *buffer;
-       int cntsiz;
-       extern char *sbrk();
-       extern char *minbrk;
-
-       cntsiz = (highpc - lowpc) * ARCDENSITY / 100;
-       if (cntsiz < MINARCS)
-               cntsiz = MINARCS;
-       monsize = (highpc - lowpc + HISTFRACTION - 1) / HISTFRACTION
-               + sizeof(struct phdr) + cntsiz * sizeof(struct cnt);
-       monsize = (monsize + 1) & ~1;
-       buffer = sbrk(monsize);
-       if (buffer == (char *)-1) {
-               write(2, MSG, sizeof(MSG));
-               return;
-       }
-       minbrk = sbrk(0);
-       monitor(lowpc, highpc, buffer, monsize, cntsiz);
-}
-
-/*
- *     This routine is massaged so that it may be jsb'ed to
- */
-asm(".text");
-asm("#the beginning of mcount()");
-asm(".data");
-int mcount() {
-       register int *selfpc;   /* r11 */
-       register long **cntp;   /* r10 */
-
-       /*
-        * find the return address for mcount,
-        * and address of counter pointer
-        */
-       asm("   movl    (sp),r11");     /* selfpc = ... (jsb frame) */
-       asm("   movl    r0,r10");       /* address of count local */
-       /*
-        * check that we aren't recursively invoked.
-        */
-       if (profiling)
-               goto out;
-       profiling++;
-       /*
-        * check that counter is allocated
-        */
-       if (*cntp == 0) {
-               /*
-                * check that a counter is available
-                */
-               if (cntrs++ == numctrs)
-                       goto overflow;
-               countbase->pc = selfpc;
-               *cntp = &countbase->ncall;
-               countbase++;
-       }
-       (**cntp)++;
-       profiling--;
-out:
-       asm( "  rsb" );
-
-overflow:
-#   define     TOLIMIT "mcount: counter overflow\n"
-       write( 2 , TOLIMIT , sizeof( TOLIMIT ) );
-       goto out;
-}
-asm(".text");
-asm("#the end of mcount()");
-asm(".data");
-
-int monitor(lowpc, highpc, buf, bufsiz, cntsiz) char *lowpc; char *highpc; char *buf; int bufsiz; int cntsiz; {
-       register int o;
-       struct phdr *php;
-       static int ssiz;
-       static char *sbuf;
-
-       if (lowpc == 0) {
-               moncontrol(0);
-               o = creat("mon.out", 0666);
-               write(o, sbuf, ssiz);
-               close(o);
-               return;
-       }
-       sbuf = buf;
-       ssiz = bufsiz;
-       php = (struct phdr *)&buf[0];
-       php->lpc = (int *)lowpc;
-       php->hpc = (int *)highpc;
-       php->ncnt = cntsiz;
-       numctrs = cntsiz;
-       countbase = (struct cnt *)(buf + sizeof(struct phdr));
-       o = sizeof(struct phdr) + cntsiz * sizeof(struct cnt);
-       buf += o;
-       bufsiz -= o;
-       if (bufsiz <= 0)
-               return;
-       o = (highpc - lowpc);
-       if(bufsiz < o)
-               o = ((float) bufsiz / o) * 65536;
-       else
-               o = 65536;
-       s_scale = o;
-       s_sbuf = buf;
-       s_bufsiz = bufsiz;
-       s_lowpc = lowpc;
-       moncontrol(1);
-}
-
-/*
- * Control profiling
- *     profiling is what mcount checks to see if
- *     all the data structures are ready.
- */
-int moncontrol(mode) int mode; {
-    if (mode) {
-       /* start */
-       profil(s_sbuf, s_bufsiz, s_lowpc, s_scale);
-       profiling = 0;
-    } else {
-       /* stop */
-       profil((char *)0, 0, 0, 0);
-       profiling = 3;
-    }
-}
diff --git a/lib/libstdc/errfunc.sh b/lib/libstdc/errfunc.sh
new file mode 100755 (executable)
index 0000000..3186da7
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/sh
+prefix=
+while read i
+do
+  func=`echo $i |sed -ne 's/.*: In function â€˜\(.*\)’:$/\1/p'`
+  if test -n "$func"
+  then
+    prefix="$func: "
+  else
+    echo "$prefix$i"
+  fi
+done
index 251b351..65a4bd6 100644 (file)
@@ -14,7 +14,6 @@
 #include <sys/dir.h>
 #include <sys/errno.h>
 #include <sys/exec.h>
-#include <sys/ioctl.h>
 #include <sys/proc.h>
 #include <sys/signal.h>
 #include <sys/syslog.h>
@@ -73,7 +72,7 @@ char *ecvt __P((double arg, int ndigits, int *decpt, int *sign));
 char *fcvt __P((double arg, int ndigits, int *decpt, int *sign));
 
 /* gen/fakcu.c */
-int _cleanup __P((void));
+void _cleanup __P((void));
 
 /* gen/ffs.c */
 int ffs __P((register long mask));
@@ -97,10 +96,10 @@ int insque __P((register struct vaxque *e, register struct vaxque *prev));
 
 /* gen/malloc.c */
 char *malloc __P((unsigned nbytes));
-int morecore __P((int bucket));
-int free __P((char *cp));
+void morecore __P((int bucket));
+void free __P((char *cp));
 char *realloc __P((char *cp, unsigned nbytes));
-int mstats __P((char *s));
+void mstats __P((char *s));
 
 /* gen/mkstemp.c */
 int mkstemp __P((char *as));
@@ -109,7 +108,7 @@ int mkstemp __P((char *as));
 char *mktemp __P((char *as));
 
 /* gen/qsort.c */
-int qsort __P((char *base, int n, int size, int (*compar)(void)));
+void qsort __P((char *base, int n, int size, int (*compar)(void)));
 
 /* gen/random.c */
 int srandom __P((unsigned x));
index ae3e2c9..2163d4c 100644 (file)
@@ -13,7 +13,7 @@ static char sccsid[] = "@(#)alarm.c   5.2 (Berkeley) 3/9/86";
 /*
  * Backwards compatible alarm.
  */
-#include <sys/time.h>
+/*#include <sys/time.h>*/
 
 int alarm(secs) int secs; {
        struct itimerval it, oitv;
index 907e9c1..1ed9bd2 100644 (file)
@@ -12,8 +12,8 @@
 static char sccsid[] = "@(#)closedir.c 5.2 (Berkeley) 3/9/86";
 #endif
 
-#include <sys/param.h>
-#include <sys/dir.h>
+/*#include <sys/param.h>*/
+/*#include <sys/dir.h>*/
 
 /*
  * close a directory.
index fd01034..7eb9b73 100644 (file)
@@ -46,9 +46,9 @@ static char sccsid[] = "@(#)ctime.c   5.5 (Berkeley) 3/9/86";
  * ctime(t) just calls localtime, then asctime.
  */
 
-#include <sys/time.h>
-#include <sys/types.h>
-#include <sys/timeb.h>
+/*#include <sys/time.h>*/
+/*#include <sys/types.h>*/
+/*#include <sys/timeb.h>*/
 
 static char    cbuf[26];
 static int     dmsize[12] = {
index dfa548c..e981d94 100644 (file)
@@ -4,7 +4,7 @@
 static char sccsid[] = "@(#)ctype_.c   5.4 (Berkeley) 3/9/86";
 #endif
 
-#include       <ctype.h>
+/*#include     <ctype.h>*/
 
 char _ctype_[1 + 256] = {
        0,
index 3489afb..8978ce4 100644 (file)
@@ -14,8 +14,8 @@
 static char sccsid[] = "@(#)disktab.c  5.3 (Berkeley) 3/9/86";
 #endif
 
-#include <disktab.h>
-#include <stdio.h>
+/*#include <disktab.h>*/
+/*#include <stdio.h>*/
 
 /*static       char *dgetstr();*/
 
@@ -65,7 +65,7 @@ struct disktab *getdiskbyname(name) char *name; {
        return (dp);
 }
 
-#include <ctype.h>
+/*#include <ctype.h>*/
 
 static char *tbuf;
 /*static       char *dskip();*/
index 9be5ef1..05eee41 100644 (file)
@@ -12,7 +12,7 @@ static char sccsid[] = "@(#)execvp.c  5.2 (Berkeley) 3/9/86";
  *     execlp(name, arg,...,0) (like execl, but does path search)
  *     execvp(name, argv)      (like execv, but does path search)
  */
-#include <errno.h>
+/*#include <errno.h>*/
 #define        NULL    0
 
 static char shell[] =  "/bin/sh";
index f91ff0b..c0c3eed 100644 (file)
@@ -9,5 +9,5 @@ static char sccsid[] = "@(#)fakcu.c     5.2 (Berkeley) 3/9/86";
  * Null cleanup routine to resolve reference in exit() 
  * if not using stdio.
  */
-int _cleanup() {
+void _cleanup() {
 }
index 3f2df3a..9d49213 100644 (file)
@@ -13,9 +13,9 @@
 static char sccsid[] = "@(#)fstab.c    5.2 (Berkeley) 3/9/86";
 #endif
 
-#include <fstab.h>
-#include <stdio.h>
-#include <ctype.h>
+/*#include <fstab.h>*/
+/*#include <stdio.h>*/
+/*#include <ctype.h>*/
 
 static struct fstab fs;
 static char line[BUFSIZ+1];
index a826d56..626cf63 100644 (file)
@@ -6,8 +6,8 @@
 static char sccsid[] = "@(#)getgrent.c 5.2 (Berkeley) 3/9/86";
 #endif
 
-#include <stdio.h>
-#include <grp.h>
+/*#include <stdio.h>*/
+/*#include <grp.h>*/
 
 #define        MAXGRP  200
 
index e64682f..ed5e853 100644 (file)
@@ -4,7 +4,7 @@
 static char sccsid[] = "@(#)getgrgid.c 5.2 (Berkeley) 3/9/86";
 #endif
 
-#include <grp.h>
+/*#include <grp.h>*/
 
 struct group *getgrgid(gid) register gid; {
        register struct group *p;
index c964681..65c1b9f 100644 (file)
@@ -5,7 +5,7 @@
 static char sccsid[] = "@(#)getgrnam.c 5.2 (Berkeley) 3/9/86";
 #endif
 
-#include <grp.h>
+/*#include <grp.h>*/
 
 struct group *getgrnam(name) register char *name; {
        register struct group *p;
index bbb8822..2cc87f3 100644 (file)
@@ -5,7 +5,7 @@
 static char sccsid[] = "@(#)getlogin.c 5.3 (Berkeley) 5/9/86";
 #endif
 
-#include <utmp.h>
+/*#include <utmp.h>*/
 
 static char UTMP[]     = "/etc/utmp";
 static struct utmp ubuf;
index d2c1f3f..74fdf56 100644 (file)
@@ -8,9 +8,9 @@
 static char sccsid[] = "@(#)getpass.c  5.2 (Berkeley) 3/9/86";
 #endif
 
-#include <stdio.h>
-#include <signal.h>
-#include <sgtty.h>
+/*#include <stdio.h>*/
+/*#include <signal.h>*/
+/*#include <sgtty.h>*/
 
 char *getpass(prompt) char *prompt; {
        struct sgttyb ttyb;
index b3d20fa..d20a474 100644 (file)
@@ -13,9 +13,9 @@
 static char sccsid[] = "@(#)getpwent.c 5.2 (Berkeley) 3/9/86";
 #endif
 
-#include <stdio.h>
-#include <pwd.h>
-#include <ndbm.h>
+/*#include <stdio.h>*/
+/*#include <pwd.h>*/
+/*#include <ndbm.h>*/
 
 static char EMPTY[] = "";
 static FILE *pwf = NULL;
index 29a922e..40f5028 100644 (file)
 static char sccsid[] = "@(#)getpwnamuid.c      5.2 (Berkeley) 3/9/86";
 #endif
 
-#include <stdio.h>
-#include <pwd.h>
-#include <ndbm.h>
+/*#include <stdio.h>*/
+/*#include <pwd.h>*/
+/*#include <ndbm.h>*/
 
-#include <sys/file.h>
+/*#include <sys/file.h>*/
 
 static char line[BUFSIZ+1];
 static struct passwd passwd;
index 232a1fa..1a01c5d 100644 (file)
@@ -12,9 +12,9 @@
 static char sccsid[] = "@(#)getttyent.c        5.4 (Berkeley) 5/19/86";
 #endif
 
-#include <stdio.h>
-#include <strings.h>
-#include <ttyent.h>
+/*#include <stdio.h>*/
+/*#include <strings.h>*/
+/*#include <ttyent.h>*/
 
 static char TTYFILE[] = "/etc/ttys";
 static char zapchar;
index 93d707e..2e499d0 100644 (file)
@@ -11,7 +11,7 @@
 static char sccsid[] = "@(#)getttynam.c        5.2 (Berkeley) 3/9/86";
 #endif
 
-#include <ttyent.h>
+/*#include <ttyent.h>*/
 
 struct ttyent *getttynam(tty) char *tty; {
        register struct ttyent *t;
index dcc5adb..7ef22da 100644 (file)
 static char sccsid[] = "@(#)getusershell.c     5.4 (Berkeley) 7/25/86";
 #endif
 
-#include <sys/param.h>
-#include <sys/file.h>
-#include <sys/stat.h>
-#include <ctype.h>
-#include <stdio.h>
+/*#include <sys/param.h>*/
+/*#include <sys/file.h>*/
+/*#include <sys/stat.h>*/
+/*#include <ctype.h>*/
+/*#include <stdio.h>*/
 
 #define SHELLS "/etc/shells"
 
index 4b574b6..022a443 100644 (file)
@@ -18,9 +18,9 @@ static char sccsid[] = "@(#)getwd.c   5.2 (Berkeley) 3/9/86";
  * getwd() returns the pathname of the current working directory. On error
  * an error message is copied to pathname and null pointer is returned.
  */
-#include <sys/param.h>
-#include <sys/stat.h>
-#include <sys/dir.h>
+/*#include <sys/param.h>*/
+/*#include <sys/stat.h>*/
+/*#include <sys/dir.h>*/
 
 #define GETWDERR(s)    strcpy(pathname, (s));
 
index 623c095..fab5ed1 100644 (file)
@@ -18,9 +18,9 @@ static char sccsid[] = "@(#)initgroups.c      5.3 (Berkeley) 4/27/86";
 /*
  * initgroups
  */
-#include <stdio.h>
-#include <sys/param.h>
-#include <grp.h>
+/*#include <stdio.h>*/
+/*#include <sys/param.h>*/
+/*#include <grp.h>*/
 
 /*struct group *getgrent();*/
 
index 204aada..23d9a38 100644 (file)
@@ -1,3 +1,5 @@
+#include <gen.h>
+
 /*
  * Copyright (c) 1987 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
@@ -8,7 +10,7 @@
 static char sccsid[] = "@(#)insque.c   5.1 (Berkeley) 1/27/87";
 #endif
 
-#include <gen.h>
+/*#include <gen.h>*/
 
 /*
  * insque -- vax insque instruction
index 3b827b7..185d4f5 100644 (file)
@@ -25,7 +25,7 @@ static char sccsid[] = "@(#)malloc.c  5.6 (Berkeley) 3/9/86";
  * This is designed for use in a virtual memory environment.
  */
 
-#include <sys/types.h>
+/*#include <sys/types.h>*/
 
 #define        NULL 0
 
@@ -82,16 +82,16 @@ static      int pagebucket;                 /* page size bucket */
  * for a given block size.
  */
 static u_int nmalloc[NBUCKETS];
-#include <stdio.h>
+/*#include <stdio.h>*/
 #endif
 
 #if defined(DEBUG) || defined(RCHECK)
 #define        ASSERT(p)   if (!(p)) botch("p")
-#include <stdio.h>
-static botch __P((char *s));
+/*#include <stdio.h>*/
+static void botch __P((char *s));
 static findbucket __P((union overhead *freep, int srchlen));
 
-static botch(s) char *s; {
+static void botch(s) char *s; {
        fprintf(stderr, "\r\nassertion botched: %s\r\n", s);
        (void) fflush(stderr);          /* just in case user buffered it */
        abort();
@@ -182,7 +182,7 @@ char *malloc(nbytes) unsigned nbytes; {
 /*
  * Allocate more memory to the indicated bucket.
  */
-int morecore(bucket) int bucket; {
+void morecore(bucket) int bucket; {
        register union overhead *op;
        register int sz;                /* size of desired block */
        int amt;                        /* amount to allocate */
@@ -221,7 +221,7 @@ int morecore(bucket) int bucket; {
        }
 }
 
-int free(cp) char *cp; {
+void free(cp) char *cp; {
        register int size;
        register union overhead *op;
 
@@ -349,7 +349,7 @@ static findbucket(freep, srchlen) union overhead *freep; int srchlen; {
  * for each size category, the second showing the number of mallocs -
  * frees for each size category.
  */
-int mstats(s) char *s; {
+void mstats(s) char *s; {
        register int i, j;
        register union overhead *p;
        int totfree = 0,
index 9ae25bd..c1b5c85 100644 (file)
@@ -12,7 +12,7 @@
 static char sccsid[] = "@(#)mkstemp.c  5.2 (Berkeley) 3/9/86";
 #endif
 
-#include <sys/file.h>
+/*#include <sys/file.h>*/
 
 int mkstemp(as) char *as; {
        register char *s;
index 808b6d8..02cead3 100644 (file)
 static char sccsid[] = "@(#)ndbm.c     5.3 (Berkeley) 3/9/86";
 #endif
 
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/file.h>
-#include <stdio.h>
-#include <errno.h>
-#include <ndbm.h>
+/*#include <sys/types.h>*/
+/*#include <sys/stat.h>*/
+/*#include <sys/file.h>*/
+/*#include <stdio.h>*/
+/*#include <errno.h>*/
+/*#include <ndbm.h>*/
 
 #define BYTESIZ 8
 #undef setbit
index 3244730..4fd1be3 100644 (file)
@@ -15,9 +15,9 @@
 static char sccsid[] = "@(#)nlist.c    5.2 (Berkeley) 3/9/86";
 #endif
 
-#include <sys/types.h>
-#include <a.out.h>
-#include <stdio.h>
+/*#include <sys/types.h>*/
+/*#include <a.out.h>*/
+/*#include <stdio.h>*/
 
 /*
  * nlist - retreive attributes from name list (string table version)
index 03df69f..fe89d69 100644 (file)
@@ -12,8 +12,8 @@
 static char sccsid[] = "@(#)opendir.c  5.2 (Berkeley) 3/9/86";
 #endif
 
-#include <sys/param.h>
-#include <sys/dir.h>
+/*#include <sys/param.h>*/
+/*#include <sys/dir.h>*/
 
 /*
  * open a directory.
index f4fb948..7a2d1d4 100644 (file)
@@ -16,8 +16,8 @@ static char sccsid[] = "@(#)perror.c  5.2 (Berkeley) 3/9/86";
  * Print the error indicated
  * in the cerror cell.
  */
-#include <sys/types.h>
-#include <sys/uio.h>
+/*#include <sys/types.h>*/
+/*#include <sys/uio.h>*/
 
 int    errno;
 int    sys_nerr;
index 48eae46..8d8573a 100644 (file)
@@ -16,7 +16,7 @@ static char sccsid[] = "@(#)psignal.c 5.2 (Berkeley) 3/9/86";
  * Print the name of the signal indicated
  * along with the supplied message.
  */
-#include <signal.h>
+/*#include <signal.h>*/
 
 extern char *sys_siglist[];
 
index e9b38c8..fa7bc05 100644 (file)
@@ -34,9 +34,9 @@ static  int           mthresh;                /* MTHRESHold in chars */
  * It's not...
  */
 
-static qst __P((char *base, char *max));
+static void qst __P((char *base, char *max));
 
-int qsort(base, n, size, compar) char *base; int n; int size; int (*compar)(); {
+void qsort(base, n, size, compar) char *base; int n; int size; int (*compar)(); {
        register char c, *i, *j, *lo, *hi;
        char *min, *max;
 
@@ -106,7 +106,7 @@ int qsort(base, n, size, compar) char *base; int n; int size; int (*compar)(); {
  * (And there are only three places where this is done).
  */
 
-static qst(base, max) char *base; char *max; {
+static void qst(base, max) char *base; char *max; {
        register char c, *i, *j, *jj;
        register int ii;
        char *mid, *tmp;
index f6da76b..c78922f 100644 (file)
@@ -11,7 +11,7 @@
 static char sccsid[] = "@(#)random.c   5.2 (Berkeley) 3/9/86";
 #endif
 
-#include       <stdio.h>
+/*#include     <stdio.h>*/
 
 /*
  * random.c:
@@ -207,7 +207,7 @@ char *initstate(seed, arg_state, n) unsigned seed;                  /* seed for R. N. G. */ cha
        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 807ecbb..a873340 100644 (file)
@@ -11,8 +11,8 @@
 static char sccsid[] = "@(#)readdir.c  5.2 (Berkeley) 3/9/86";
 #endif
 
-#include <sys/param.h>
-#include <sys/dir.h>
+/*#include <sys/param.h>*/
+/*#include <sys/dir.h>*/
 
 /*
  * get next entry in a directory.
index ef34b19..372f834 100644 (file)
@@ -1,3 +1,5 @@
+#include <gen.h>
+
 /*
  * Copyright (c) 1987 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
@@ -8,7 +10,7 @@
 static char sccsid[] = "@(#)remque.c   5.1 (Berkeley) 1/27/87";
 #endif
 
-#include <gen.h>
+/*#include <gen.h>*/
 
 /*
  * remque -- vax remque instruction
index 073e767..32087b0 100644 (file)
@@ -20,9 +20,9 @@ static char sccsid[] = "@(#)scandir.c 5.2 (Berkeley) 3/9/86";
  * struct direct (through namelist). Returns -1 if there were any errors.
  */
 
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/dir.h>
+/*#include <sys/types.h>*/
+/*#include <sys/stat.h>*/
+/*#include <sys/dir.h>*/
 
 int scandir(dirname, namelist, select, dcomp) char *dirname; struct direct *(*namelist[]); int (*select)(); int (*dcomp)(); {
        register struct direct *d, *p, **names;
index 6f698ed..342f156 100644 (file)
@@ -11,8 +11,8 @@
 static char sccsid[] = "@(#)seekdir.c  5.2 (Berkeley) 3/9/86";
 #endif
 
-#include <sys/param.h>
-#include <sys/dir.h>
+/*#include <sys/param.h>*/
+/*#include <sys/dir.h>*/
 
 /*
  * seek to an entry in a directory.
index 22cb5ab..67df098 100644 (file)
@@ -10,7 +10,7 @@
 static char sccsid[] = "@(#)siginterrupt.c     5.2 (Berkeley) 3/9/86";
 #endif
 
-#include <signal.h>
+/*#include <signal.h>*/
 
 /*
  * Set signal state to prevent restart of system calls
index 71d646d..102bef6 100644 (file)
@@ -10,7 +10,7 @@
 static char sccsid[] = "@(#)siglist.c  5.2 (Berkeley) 3/9/86";
 #endif
 
-#include <signal.h>
+/*#include <signal.h>*/
 
 char   *sys_siglist[NSIG] = {
        "Signal 0",
index f1da9f4..a8a3d42 100644 (file)
@@ -13,7 +13,7 @@ static char sccsid[] = "@(#)signal.c  5.2 (Berkeley) 3/9/86";
 /*
  * Almost backwards compatible signal.
  */
-#include <signal.h>
+/*#include <signal.h>*/
 
 int (*signal(s, a))() int s; int (*a)(); {
        struct sigvec osv, sv;
index 1ea08e5..a9ad9d9 100644 (file)
 static char sccsid[] = "@(#)sleep.c    5.2 (Berkeley) 3/9/86";
 #endif
 
-#include <sys/time.h>
-#include <signal.h>
+/*#include <sys/time.h>*/
+/*#include <signal.h>*/
 
 #define        setvec(vec, a) \
        vec.sv_handler = a; vec.sv_mask = vec.sv_onstack = 0
 
 static int ringring;
 
-static sleepx __P((void));
+static void sleepx __P((void));
 
-int sleep(n) unsigned n; {
+void sleep(n) unsigned n; {
        int sleepx(), omask;
        struct itimerval itv, oitv;
        register struct itimerval *itp = &itv;
@@ -61,7 +61,6 @@ int sleep(n) unsigned n; {
        (void) setitimer(ITIMER_REAL, &oitv, (struct itimerval *)0);
 }
 
-static sleepx() {
-
+static void sleepx() {
        ringring = 1;
 }
index 92646e5..71f77e0 100644 (file)
@@ -36,13 +36,13 @@ static char sccsid[] = "@(#)syslog.c        5.9 (Berkeley) 5/7/86";
  * Modified to use UNIX domain IPC by Ralph Campbell
  */
 
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/file.h>
-#include <sys/signal.h>
-#include <sys/syslog.h>
-#include <netdb.h>
-#include <strings.h>
+/*#include <sys/types.h>*/
+/*#include <sys/socket.h>*/
+/*#include <sys/file.h>*/
+/*#include <sys/signal.h>*/
+/*#include <sys/syslog.h>*/
+/*#include <netdb.h>*/
+/*#include <strings.h>*/
 
 #define        MAXLINE 1024                    /* max message size */
 #define NULL   0                       /* manifest */
@@ -65,7 +65,7 @@ static struct sockaddr SyslogAddr;    /* AF_UNIX address of local logger */
 extern int errno, sys_nerr;
 extern char *sys_errlist[];
 
-int syslog(pri, fmt, p0, p1, p2, p3, p4) int pri; char *fmt; int p0; int p1; int p2; int p3; int p4; {
+void syslog(pri, fmt, p0, p1, p2, p3, p4) int pri; char *fmt; int p0; int p1; int p2; int p3; int p4; {
        char buf[MAXLINE + 1], outline[MAXLINE + 1];
        register char *b, *f, *o;
        register int c;
@@ -160,7 +160,7 @@ int syslog(pri, fmt, p0, p1, p2, p3, p4) int pri; char *fmt; int p0; int p1; int
  * OPENLOG -- open system log
  */
 
-int openlog(ident, logstat, logfac) char *ident; int logstat; int logfac; {
+void openlog(ident, logstat, logfac) char *ident; int logstat; int logfac; {
        if (ident != NULL)
                LogTag = ident;
        LogStat = logstat;
@@ -180,8 +180,7 @@ int openlog(ident, logstat, logfac) char *ident; int logstat; int logfac; {
  * CLOSELOG -- close the system log
  */
 
-int closelog() {
-
+void closelog() {
        (void) close(LogFile);
        LogFile = -1;
 }
index bb41d76..f138762 100644 (file)
@@ -7,7 +7,7 @@
 static char sccsid[] = "@(#)system.c   5.2 (Berkeley) 3/9/86";
 #endif
 
-#include       <signal.h>
+/*#include     <signal.h>*/
 
 int system(s) char *s; {
        int status, pid, w;
index 841a348..01a2761 100644 (file)
@@ -11,8 +11,8 @@
 static char sccsid[] = "@(#)telldir.c  5.2 (Berkeley) 3/9/86";
 #endif
 
-#include <sys/param.h>
-#include <sys/dir.h>
+/*#include <sys/param.h>*/
+/*#include <sys/dir.h>*/
 
 /*
  * return a pointer into a directory
index 107777b..f8e66b2 100644 (file)
@@ -14,8 +14,8 @@ static char sccsid[] = "@(#)time.c    5.3 (Berkeley) 3/9/86";
 /*
  * Backwards compatible time call.
  */
-#include <sys/types.h>
-#include <sys/time.h>
+/*#include <sys/types.h>*/
+/*#include <sys/time.h>*/
 
 long time(t) time_t *t; {
        struct timeval tt;
index 7c1ac4b..49aad96 100644 (file)
@@ -16,8 +16,8 @@ static char sccsid[] = "@(#)ttyname.c 5.2 (Berkeley) 3/9/86";
 
 #define        NULL    0
 #include <sys/param.h>
-#include <sys/dir.h>
-#include <sys/stat.h>
+/*#include <sys/dir.h>*/
+/*#include <sys/stat.h>*/
 
 static char    dev[]   = "/dev/";
 /*char *strcpy();*/
index f885177..e429f18 100644 (file)
@@ -17,7 +17,7 @@ static char sccsid[] = "@(#)ttyslot.c 5.2 (Berkeley) 3/9/86";
  * corresponding to the current user: try for file 0, 1, 2.
  * Definition is the line number in the /etc/ttys file.
  */
-#include <ttyent.h>
+/*#include <ttyent.h>*/
 
 /*char *ttyname();*/
 /*char *rindex();*/
index 847cf51..22624f6 100644 (file)
@@ -10,7 +10,7 @@
 static char sccsid[] = "@(#)ualarm.c   5.2 (Berkeley) 3/9/86";
 #endif
 
-#include <sys/time.h>
+/*#include <sys/time.h>*/
 
 #define        USPS    1000000         /* # of microseconds in a second */
 
index e02b93c..e397535 100644 (file)
@@ -11,8 +11,8 @@
 static char sccsid[] = "@(#)usleep.c   5.2 (Berkeley) 3/9/86";
 #endif
 
-#include <sys/time.h>
-#include <signal.h>
+/*#include <sys/time.h>*/
+/*#include <signal.h>*/
 
 #define USPS   1000000         /* number of microseconds in a second */
 #define TICK   10000           /* system clock resolution in microseconds */
@@ -22,9 +22,9 @@ static char sccsid[] = "@(#)usleep.c  5.2 (Berkeley) 3/9/86";
 
 static int ringring;
 
-static sleepx __P((void));
+static void sleepx __P((void));
 
-int usleep(n) unsigned n; {
+void usleep(n) unsigned n; {
        int sleepx(), omask;
        struct itimerval itv, oitv;
        register struct itimerval *itp = &itv;
@@ -64,7 +64,6 @@ int usleep(n) unsigned n; {
        (void) setitimer(ITIMER_REAL, &oitv, (struct itimerval *)0);
 }
 
-static sleepx() {
-
+static void sleepx() {
        ringring = 1;
 }
index 96ba185..520f891 100644 (file)
@@ -26,9 +26,6 @@ compat-sys5/strrchr.c string.h
 compat-sys5/strspn.c string.h
 compat-sys5/strtok.c string.h
 compat-sys5/tmpnam.c
-csu/crt0.c
-csu/gmon.c
-csu/mon.c
 gen/abort.c
 gen/abs.c
 gen/alarm.c sys/time.h
@@ -67,7 +64,6 @@ gen/getwd.c sys/dir.h
 gen/index.c strings.h
 gen/initgroups.c grp.h
 gen/insque.c
-gen/isatty.c sys/ioctl.h
 gen/ldexp.c math.h
 gen/malloc.c
 gen/mkstemp.c
@@ -239,6 +235,7 @@ sys/getsockopt.c sys/socket.h
 sys/gettimeofday.c sys/time.h
 sys/getuid.c sys/proc.h
 sys/ioctl.c sys/ioctl.h
+sys/isatty.c sys/ioctl.h
 sys/kill.c sys/signal.h
 sys/killpg.c sys/signal.h
 sys/link.c sys/file.h
@@ -297,6 +294,7 @@ sys/umask.c sys/file.h
 sys/umount.c sys/mount.h
 sys/unlink.c sys/file.h
 sys/utimes.c sys/time.h
+sys/vfork.c sys/proc.h
 sys/vhangup.c
 sys/wait3.c sys/wait.h
 sys/wait.c sys/wait.h
index c13b71e..f900f2a 100644 (file)
@@ -13,9 +13,9 @@
 static char sccsid[] = "@(#)inet_addr.c        5.2 (Berkeley) 3/9/86";
 #endif
 
-#include <sys/types.h>
-#include <ctype.h>
-#include <netinet/in.h>
+/*#include <sys/types.h>*/
+/*#include <ctype.h>*/
+/*#include <netinet/in.h>*/
 
 /*
  * Internet address interpretation routine.
index f68477d..2ef4e91 100644 (file)
@@ -13,8 +13,8 @@
 static char sccsid[] = "@(#)inet_lnaof.c       5.2 (Berkeley) 3/9/86";
 #endif
 
-#include <sys/types.h>
-#include <netinet/in.h>
+/*#include <sys/types.h>*/
+/*#include <netinet/in.h>*/
 
 /*
  * Return the local network address portion of an
index ffd9ec6..4e6c28a 100644 (file)
@@ -13,8 +13,8 @@
 static char sccsid[] = "@(#)inet_makeaddr.c    5.1 (Berkeley) 3/11/86";
 #endif
 
-#include <sys/types.h>
-#include <netinet/in.h>
+/*#include <sys/types.h>*/
+/*#include <netinet/in.h>*/
 
 /*
  * Formulate an Internet address from network + host.  Used in
index 5d0ea7f..113bd7e 100644 (file)
@@ -13,8 +13,8 @@
 static char sccsid[] = "@(#)inet_netof.c       5.2 (Berkeley) 3/9/86";
 #endif
 
-#include <sys/types.h>
-#include <netinet/in.h>
+/*#include <sys/types.h>*/
+/*#include <netinet/in.h>*/
 
 /*
  * Return the network number from an internet
index 7a696c2..de90705 100644 (file)
@@ -12,8 +12,8 @@
 static char sccsid[] = "@(#)inet_network.c     5.2 (Berkeley) 3/9/86";
 #endif
 
-#include <sys/types.h>
-#include <ctype.h>
+/*#include <sys/types.h>*/
+/*#include <ctype.h>*/
 
 /*
  * Internet network address interpretation routine.
index 2b03d99..3d64d67 100644 (file)
@@ -16,8 +16,8 @@ static char sccsid[] = "@(#)inet_ntoa.c       5.2 (Berkeley) 3/9/86";
  * Convert network-format internet address
  * to base 256 d.d.d.d representation.
  */
-#include <sys/types.h>
-#include <netinet/in.h>
+/*#include <sys/types.h>*/
+/*#include <netinet/in.h>*/
 
 char *inet_ntoa(in) struct in_addr in; {
        static char b[18];
index 5f5c599..9387a68 100644 (file)
@@ -1,6 +1,6 @@
 diff --unified --recursive --new-file libstdc.orig/a.out.h libstdc/a.out.h
---- libstdc.orig/a.out.h       2017-01-19 02:19:04.343169028 +1100
-+++ libstdc/a.out.h    2017-01-19 02:19:04.351169187 +1100
+--- libstdc.orig/a.out.h       2017-01-19 15:17:46.190529992 +1100
++++ libstdc/a.out.h    2017-01-19 15:17:46.198529987 +1100
 @@ -39,44 +39,4 @@
                :4;             /* nothing, yet */
  };
@@ -47,9 +47,39 @@ diff --unified --recursive --new-file libstdc.orig/a.out.h libstdc/a.out.h
 - */
 -#define       N_FORMAT        "%08x"
 +#include <nlist.h>
+diff --unified --recursive --new-file libstdc.orig/compat-4.1/ftime.c libstdc/compat-4.1/ftime.c
+--- libstdc.orig/compat-4.1/ftime.c    2017-01-19 15:17:46.190529992 +1100
++++ libstdc/compat-4.1/ftime.c 2017-01-19 15:19:31.050463867 +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 libstdc.orig/compat-4.1/gtty.c libstdc/compat-4.1/gtty.c
---- libstdc.orig/compat-4.1/gtty.c     2017-01-19 02:19:04.339168949 +1100
-+++ libstdc/compat-4.1/gtty.c  2017-01-19 02:19:04.351169187 +1100
+--- libstdc.orig/compat-4.1/gtty.c     2017-01-19 15:17:46.190529992 +1100
++++ libstdc/compat-4.1/gtty.c  2017-01-19 15:17:46.198529987 +1100
 @@ -15,7 +15,7 @@
  #include <sgtty.h>
  
@@ -60,8 +90,8 @@ diff --unified --recursive --new-file libstdc.orig/compat-4.1/gtty.c libstdc/com
        return(ioctl(fd, TIOCGETP, ap));
  }
 diff --unified --recursive --new-file libstdc.orig/compat-4.1/stty.c libstdc/compat-4.1/stty.c
---- libstdc.orig/compat-4.1/stty.c     2017-01-19 02:19:04.339168949 +1100
-+++ libstdc/compat-4.1/stty.c  2017-01-19 02:19:04.351169187 +1100
+--- libstdc.orig/compat-4.1/stty.c     2017-01-19 15:17:46.190529992 +1100
++++ libstdc/compat-4.1/stty.c  2017-01-19 15:17:46.198529987 +1100
 @@ -15,7 +15,7 @@
  #include <sgtty.h>
  
@@ -71,8 +101,49 @@ diff --unified --recursive --new-file libstdc.orig/compat-4.1/stty.c libstdc/com
  
        return(ioctl(fd, TIOCSETP, ap));
  }
+diff --unified --recursive --new-file libstdc.orig/compat-4.1/vtimes.c libstdc/compat-4.1/vtimes.c
+--- libstdc.orig/compat-4.1/vtimes.c   2017-01-19 15:17:46.190529992 +1100
++++ libstdc/compat-4.1/vtimes.c        2017-01-19 15:17:46.198529987 +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 libstdc.orig/fcntl.h libstdc/fcntl.h
---- libstdc.orig/fcntl.h       2017-01-19 02:19:04.343169028 +1100
+--- libstdc.orig/fcntl.h       2017-01-19 15:17:46.190529992 +1100
 +++ libstdc/fcntl.h    1970-01-01 10:00:00.000000000 +1000
 @@ -1,40 +0,0 @@
 -/*
@@ -115,9 +186,19 @@ diff --unified --recursive --new-file libstdc.orig/fcntl.h libstdc/fcntl.h
 -#define       FTRUNC          02000           /* truncate to zero length */
 -#define       FEXCL           04000           /* error if already created */
 -#endif
+diff --unified --recursive --new-file libstdc.orig/gen/fakcu.c libstdc/gen/fakcu.c
+--- libstdc.orig/gen/fakcu.c   2017-01-19 15:17:46.198529987 +1100
++++ libstdc/gen/fakcu.c        2017-01-19 15:21:02.578410269 +1100
+@@ -6,5 +6,6 @@
+  * Null cleanup routine to resolve reference in exit() 
+  * if not using stdio.
+  */
++void
+ _cleanup() {
+ }
 diff --unified --recursive --new-file libstdc.orig/gen/insque.c libstdc/gen/insque.c
---- libstdc.orig/gen/insque.c  2017-01-19 02:19:04.347169107 +1100
-+++ libstdc/gen/insque.c       2017-01-19 02:19:04.351169187 +1100
+--- libstdc.orig/gen/insque.c  2017-01-19 15:17:46.194529989 +1100
++++ libstdc/gen/insque.c       2017-01-19 15:17:46.198529987 +1100
 @@ -8,16 +8,19 @@
  static char sccsid[] = "@(#)insque.c  5.1 (Berkeley) 1/27/87";
  #endif
@@ -142,8 +223,65 @@ diff --unified --recursive --new-file libstdc.orig/gen/insque.c libstdc/gen/insq
  
  insque(e, prev)
        register struct vaxque *e, *prev; {
+diff --unified --recursive --new-file libstdc.orig/gen/isatty.c libstdc/gen/isatty.c
+--- libstdc.orig/gen/isatty.c  2017-01-19 15:17:46.194529989 +1100
++++ libstdc/gen/isatty.c       1970-01-01 10:00:00.000000000 +1000
+@@ -1,17 +0,0 @@
+-#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 libstdc.orig/gen/malloc.c libstdc/gen/malloc.c
+--- libstdc.orig/gen/malloc.c  2017-01-19 15:17:46.198529987 +1100
++++ libstdc/gen/malloc.c       2017-01-19 15:19:41.562457507 +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; {
+       fprintf(stderr, "\r\nassertion botched: %s\r\n", s);
+@@ -177,6 +177,7 @@
+ /*
+  * Allocate more memory to the indicated bucket.
+  */
++void
+ morecore(bucket)
+       int bucket; {
+       register union overhead *op;
+@@ -217,6 +218,7 @@
+       }
+ }
++void
+ free(cp)
+       char *cp; {
+       register int size;
+@@ -352,6 +354,7 @@
+  * for each size category, the second showing the number of mallocs -
+  * frees for each size category.
+  */
++void
+ mstats(s)
+       char *s; {
+       register int i, j;
 diff --unified --recursive --new-file libstdc.orig/gen/popen.c libstdc/gen/popen.c
---- libstdc.orig/gen/popen.c   2017-01-19 02:19:04.347169107 +1100
+--- libstdc.orig/gen/popen.c   2017-01-19 15:17:46.198529987 +1100
 +++ libstdc/gen/popen.c        1970-01-01 10:00:00.000000000 +1000
 @@ -1,77 +0,0 @@
 -/*
@@ -223,9 +361,41 @@ diff --unified --recursive --new-file libstdc.orig/gen/popen.c libstdc/gen/popen
 -      (void) sigsetmask(omask);
 -      return (pid == -1 ? -1 : status);
 -}
+diff --unified --recursive --new-file libstdc.orig/gen/qsort.c libstdc/gen/qsort.c
+--- libstdc.orig/gen/qsort.c   2017-01-19 15:17:46.198529987 +1100
++++ libstdc/gen/qsort.c        2017-01-19 15:17:46.198529987 +1100
+@@ -32,6 +32,7 @@
+  * It's not...
+  */
++void
+ qsort(base, n, size, compar)
+       char    *base;
+       int     n;
+@@ -106,7 +107,7 @@
+  * (And there are only three places where this is done).
+  */
+-static
++static void
+ qst(base, max)
+       char *base, *max; {
+       register char c, *i, *j, *jj;
+diff --unified --recursive --new-file libstdc.orig/gen/random.c libstdc/gen/random.c
+--- libstdc.orig/gen/random.c  2017-01-19 15:17:46.198529987 +1100
++++ libstdc/gen/random.c       2017-01-19 15:17:46.198529987 +1100
+@@ -222,7 +222,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 libstdc.orig/gen/regex.c libstdc/gen/regex.c
---- libstdc.orig/gen/regex.c   2017-01-19 02:19:04.347169107 +1100
-+++ libstdc/gen/regex.c        2017-01-19 02:19:04.351169187 +1100
+--- libstdc.orig/gen/regex.c   2017-01-19 15:17:46.198529987 +1100
++++ libstdc/gen/regex.c        2017-01-19 15:17:46.198529987 +1100
 @@ -8,8 +8,6 @@
  static char sccsid[] = "@(#)regex.c   5.2 (Berkeley) 3/9/86";
  #endif
@@ -236,8 +406,8 @@ diff --unified --recursive --new-file libstdc.orig/gen/regex.c libstdc/gen/regex
   * routines to do regular expression matching
   *
 diff --unified --recursive --new-file libstdc.orig/gen/remque.c libstdc/gen/remque.c
---- libstdc.orig/gen/remque.c  2017-01-19 02:19:04.347169107 +1100
-+++ libstdc/gen/remque.c       2017-01-19 02:19:04.351169187 +1100
+--- libstdc.orig/gen/remque.c  2017-01-19 15:17:46.198529987 +1100
++++ libstdc/gen/remque.c       2017-01-19 15:17:46.202529984 +1100
 @@ -8,16 +8,19 @@
  static char sccsid[] = "@(#)remque.c  5.1 (Berkeley) 1/27/87";
  #endif
@@ -262,37 +432,191 @@ diff --unified --recursive --new-file libstdc.orig/gen/remque.c libstdc/gen/remq
  
  remque(e)
        register struct vaxque *e; {
+diff --unified --recursive --new-file libstdc.orig/gen/sleep.c libstdc/gen/sleep.c
+--- libstdc.orig/gen/sleep.c   2017-01-19 15:17:46.198529987 +1100
++++ libstdc/gen/sleep.c        2017-01-19 15:17:46.202529984 +1100
+@@ -16,6 +16,7 @@
+ static int ringring;
++void
+ sleep(n)
+       unsigned n; {
+       int sleepx(), omask;
+@@ -57,8 +58,7 @@
+       (void) setitimer(ITIMER_REAL, &oitv, (struct itimerval *)0);
+ }
+-static
++static void
+ sleepx() {
+-
+       ringring = 1;
+ }
+diff --unified --recursive --new-file libstdc.orig/gen/syslog.c libstdc/gen/syslog.c
+--- libstdc.orig/gen/syslog.c  2017-01-19 15:17:46.198529987 +1100
++++ libstdc/gen/syslog.c       2017-01-19 15:17:46.202529984 +1100
+@@ -54,6 +54,7 @@
+ extern        int errno, sys_nerr;
+ extern        char *sys_errlist[];
++void
+ syslog(pri, fmt, p0, p1, p2, p3, p4)
+       int pri;
+       char *fmt; {
+@@ -151,6 +152,7 @@
+  * OPENLOG -- open system log
+  */
++void
+ openlog(ident, logstat, logfac)
+       char *ident;
+       int logstat, logfac; {
+@@ -173,8 +175,8 @@
+  * CLOSELOG -- close the system log
+  */
++void
+ closelog() {
+-
+       (void) close(LogFile);
+       LogFile = -1;
+ }
+diff --unified --recursive --new-file libstdc.orig/gen/usleep.c libstdc/gen/usleep.c
+--- libstdc.orig/gen/usleep.c  2017-01-19 15:17:46.194529989 +1100
++++ libstdc/gen/usleep.c       2017-01-19 15:17:46.202529984 +1100
+@@ -19,6 +19,7 @@
+ static int ringring;
++void
+ usleep(n)
+       unsigned n; {
+       int sleepx(), omask;
+@@ -60,8 +61,7 @@
+       (void) setitimer(ITIMER_REAL, &oitv, (struct itimerval *)0);
+ }
+-static
++static void
+ sleepx() {
+-
+       ringring = 1;
+ }
 diff --unified --recursive --new-file libstdc.orig/gen.h libstdc/gen.h
 --- libstdc.orig/gen.h 1970-01-01 10:00:00.000000000 +1000
-+++ libstdc/gen.h      2017-01-19 02:19:04.351169187 +1100
++++ libstdc/gen.h      2017-01-19 15:17:46.202529984 +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 libstdc.orig/net/ruserpass.c libstdc/net/ruserpass.c
+--- libstdc.orig/net/ruserpass.c       2017-01-19 15:17:46.190529992 +1100
++++ libstdc/net/ruserpass.c    2017-01-19 15:17:46.202529984 +1100
+@@ -19,6 +19,7 @@
+ struct        utmp *getutmp();
+ static        FILE *cfile;
++void
+ ruserpass(host, aname, apass)
+       char *host, **aname, **apass; {
+@@ -45,7 +46,7 @@
+       }
+ }
+-static
++static void
+ renv(host, aname, apass)
+       char *host, **aname, **apass; {
+       register char *cp;
+@@ -72,8 +73,7 @@
+       mkpwclear(cp, host[0], *apass);
+ }
+-static
+-char *
++static char *
+ renvlook(host)
+       char *host; {
+       register char *cp, **env;
+@@ -125,7 +125,7 @@
+       0,              0
+ };
+-static
++static void
+ rnetrc(host, aname, apass)
+       char *host, **aname, **apass; {
+       char *hdir, buf[BUFSIZ];
+@@ -482,7 +482,7 @@
+  * Set up the key schedule from the key.
+  */
+-static
++static void
+ nbssetkey(key)
+ char *key; {
+       register i, j, k;
+@@ -606,7 +606,7 @@
+  * The payoff: encrypt a block.
+  */
+-static
++static void
+ blkencrypt(block, edflag)
+ char *block; {
+       int i, ii;
+@@ -720,7 +720,7 @@
+       return(NULL);
+ }
+-static
++static void
+ sreverse(sto, sfrom)
+       register char *sto, *sfrom; {
+       register int i;
+@@ -763,6 +763,7 @@
+       return (skey);
+ }
++void
+ mkpwunclear(spasswd,mch,sencpasswd)
+       char mch, *spasswd, *sencpasswd; {
+       register char *skey;
+@@ -779,6 +780,7 @@
+       nbsencrypt(spasswd, skey, sencpasswd);
+ }
++void
+ mkpwclear(sencpasswd,mch,spasswd)
+       char mch, *spasswd, *sencpasswd; {
+       register char *skey;
 diff --unified --recursive --new-file libstdc.orig/net.h libstdc/net.h
 --- libstdc.orig/net.h 1970-01-01 10:00:00.000000000 +1000
-+++ libstdc/net.h      2017-01-19 02:19:04.351169187 +1100
-@@ -0,0 +1,15 @@
++++ libstdc/net.h      2017-01-19 15:17:46.202529984 +1100
+@@ -0,0 +1,16 @@
 +/* formerly duplicated in netinet/in.h and netns/ns.h */
-+#if !defined(vax) && !defined(ntohl) && !defined(lint)
++/* confuses cproto which thinks #define names are types or type modifiers */
++/*#if !defined(vax) && !defined(ntohl) && !defined(lint)*/
 +/*
 + * Macros for number representation conversion.
 + */
-+#define       ntohl(x)        (x)
-+#define       ntohs(x)        (x)
-+#define       htonl(x)        (x)
-+#define       htons(x)        (x)
-+#endif
++/*#define     ntohl(x)        (x)*/
++/*#define     ntohs(x)        (x)*/
++/*#define     htonl(x)        (x)*/
++/*#define     htons(x)        (x)*/
++/*#endif*/
 +
-+#if !defined(ntohl) && (defined(vax) || defined(lint))
++/*#if !defined(ntohl) && (defined(vax) || defined(lint))*/
 +u_short       ntohs(), htons();
 +u_long        ntohl(), htonl();
-+#endif
++/*#endif*/
 diff --unified --recursive --new-file libstdc.orig/netinet/in.h libstdc/netinet/in.h
---- libstdc.orig/netinet/in.h  2017-01-19 02:19:04.347169107 +1100
-+++ libstdc/netinet/in.h       2017-01-19 02:19:04.351169187 +1100
+--- libstdc.orig/netinet/in.h  2017-01-19 15:17:46.194529989 +1100
++++ libstdc/netinet/in.h       2017-01-19 15:17:46.202529984 +1100
 @@ -90,20 +90,21 @@
   */
  #define       IP_OPTIONS      1               /* set/get IP per-packet options */
@@ -326,8 +650,8 @@ diff --unified --recursive --new-file libstdc.orig/netinet/in.h libstdc/netinet/
  #ifdef KERNEL
  extern        struct domain inetdomain;
 diff --unified --recursive --new-file libstdc.orig/netinet/ip.h libstdc/netinet/ip.h
---- libstdc.orig/netinet/ip.h  2017-01-19 02:19:04.347169107 +1100
-+++ libstdc/netinet/ip.h       2017-01-19 02:19:04.351169187 +1100
+--- libstdc.orig/netinet/ip.h  2017-01-19 15:17:46.194529989 +1100
++++ libstdc/netinet/ip.h       2017-01-19 15:17:46.202529984 +1100
 @@ -81,7 +81,7 @@
                        struct in_addr ipt_addr;
                        n_long ipt_time;
@@ -338,8 +662,8 @@ diff --unified --recursive --new-file libstdc.orig/netinet/ip.h libstdc/netinet/
  
  /* flag bits for ipt_flg */
 diff --unified --recursive --new-file libstdc.orig/netinet/tcp.h libstdc/netinet/tcp.h
---- libstdc.orig/netinet/tcp.h 2017-01-19 02:19:04.347169107 +1100
-+++ libstdc/netinet/tcp.h      2017-01-19 02:19:04.351169187 +1100
+--- libstdc.orig/netinet/tcp.h 2017-01-19 15:17:46.194529989 +1100
++++ libstdc/netinet/tcp.h      2017-01-19 15:17:46.202529984 +1100
 @@ -44,7 +44,9 @@
  #ifdef        lint
  #define       TCP_MSS 536
@@ -352,8 +676,8 @@ diff --unified --recursive --new-file libstdc.orig/netinet/tcp.h libstdc/netinet
  
  /*
 diff --unified --recursive --new-file libstdc.orig/netns/ns.h libstdc/netns/ns.h
---- libstdc.orig/netns/ns.h    2017-01-19 02:19:04.347169107 +1100
-+++ libstdc/netns/ns.h 2017-01-19 02:19:04.351169187 +1100
+--- libstdc.orig/netns/ns.h    2017-01-19 15:17:46.194529989 +1100
++++ libstdc/netns/ns.h 2017-01-19 15:17:46.202529984 +1100
 @@ -103,20 +103,21 @@
  #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))
@@ -386,9 +710,21 @@ diff --unified --recursive --new-file libstdc.orig/netns/ns.h libstdc/netns/ns.h
  
  #ifdef KERNEL
  extern struct domain nsdomain;
+diff --unified --recursive --new-file libstdc.orig/ns/ns_addr.c libstdc/ns/ns_addr.c
+--- libstdc.orig/ns/ns_addr.c  2017-01-19 15:17:46.190529992 +1100
++++ libstdc/ns/ns_addr.c       2017-01-19 15:17:46.202529984 +1100
+@@ -62,7 +62,7 @@
+       return (addr);
+ }
+-static
++static void
+ Field(buf, out, len)
+ char *buf;
+ u_char *out;
 diff --unified --recursive --new-file libstdc.orig/stdio/doscan.c libstdc/stdio/doscan.c
---- libstdc.orig/stdio/doscan.c        2017-01-19 02:19:04.339168949 +1100
-+++ libstdc/stdio/doscan.c     2017-01-19 02:19:04.351169187 +1100
+--- libstdc.orig/stdio/doscan.c        2017-01-19 15:17:46.190529992 +1100
++++ libstdc/stdio/doscan.c     2017-01-19 15:17:46.202529984 +1100
 @@ -3,7 +3,8 @@
  #endif
  
@@ -399,16 +735,12 @@ diff --unified --recursive --new-file libstdc.orig/stdio/doscan.c libstdc/stdio/
  
  #define       SPC     01
  #define       STP     02
-@@ -27,13 +28,13 @@
-       0,0,0,0,0,0,0,0,
- };
--_doscan(iop, fmt, argp)
-+_doscan(iop, fmt, ap)
+@@ -30,10 +31,10 @@
+ _doscan(iop, fmt, argp)
  FILE *iop;
  register char *fmt;
 -register int **argp; {
-+register va_list ap; {
++register va_list argp; {
        register int ch;
        int nmatch, len, ch1;
 -      int **ptr, fileended, size;
@@ -421,7 +753,7 @@ diff --unified --recursive --new-file libstdc.orig/stdio/doscan.c libstdc/stdio/
                ptr = 0;
                if (ch != '*')
 -                      ptr = argp++;
-+                      ptr = va_arg(ap, int *);
++                      ptr = va_arg(argp, int *);
                else
                        ch = *fmt++;
                len = 0;
@@ -472,9 +804,36 @@ diff --unified --recursive --new-file libstdc.orig/stdio/doscan.c libstdc/stdio/
                break;
        }
        return(1);
+diff --unified --recursive --new-file libstdc.orig/stdio/findiop.c libstdc/stdio/findiop.c
+--- libstdc.orig/stdio/findiop.c       2017-01-19 15:17:46.190529992 +1100
++++ libstdc/stdio/findiop.c    2017-01-19 15:17:46.202529984 +1100
+@@ -89,6 +89,7 @@
+       return (1);
+ }
++void
+ f_prealloc() {
+       register FILE **iov;
+       register FILE *fp;
+@@ -101,6 +102,7 @@
+                       *iov = (FILE *)calloc(1, sizeof **iov);
+ }
++void
+ _fwalk(function)
+       register int (*function)(); {
+       register FILE **iov;
+@@ -117,6 +119,7 @@
+       }
+ }
++void
+ _cleanup() {
+       extern int fclose();
 diff --unified --recursive --new-file libstdc.orig/stdio/fprintf.c libstdc/stdio/fprintf.c
---- libstdc.orig/stdio/fprintf.c       2017-01-19 02:19:04.339168949 +1100
-+++ libstdc/stdio/fprintf.c    2017-01-19 02:19:04.351169187 +1100
+--- libstdc.orig/stdio/fprintf.c       2017-01-19 15:17:46.190529992 +1100
++++ libstdc/stdio/fprintf.c    2017-01-19 15:17:46.202529984 +1100
 @@ -1,31 +1,48 @@
  /*
   * Copyright (c) 1980 Regents of the University of California.
@@ -511,17 +870,17 @@ diff --unified --recursive --new-file libstdc.orig/stdio/fprintf.c libstdc/stdio
 +      register FILE *iop;
 +      char *fmt;
 +      va_dcl {
-+      va_list ap;
++      va_list argp;
 +      int len;
        char localbuf[BUFSIZ];
  
-+      va_start(ap);
++      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, ap, iop);
++              len = _doprnt(fmt, argp, iop);
                fflush(iop);
                iop->_flag |= _IONBF;
                iop->_base = NULL;
@@ -530,13 +889,13 @@ diff --unified --recursive --new-file libstdc.orig/stdio/fprintf.c libstdc/stdio
        } else
 -              _doprnt(fmt, &args, iop);
 -      return(ferror(iop)? EOF: 0);
-+              len = _doprnt(fmt, ap, iop);
-+      va_end(ap);
++              len = _doprnt(fmt, argp, iop);
++      va_end(argp);
 +      return(ferror(iop) ? EOF : len);
  }
 diff --unified --recursive --new-file libstdc.orig/stdio/popen.c libstdc/stdio/popen.c
 --- libstdc.orig/stdio/popen.c 1970-01-01 10:00:00.000000000 +1000
-+++ libstdc/stdio/popen.c      2017-01-19 02:19:04.351169187 +1100
++++ libstdc/stdio/popen.c      2017-01-19 15:17:46.202529984 +1100
 @@ -0,0 +1,77 @@
 +/*
 + * Copyright (c) 1980 Regents of the University of California.
@@ -616,8 +975,8 @@ diff --unified --recursive --new-file libstdc.orig/stdio/popen.c libstdc/stdio/p
 +      return (pid == -1 ? -1 : status);
 +}
 diff --unified --recursive --new-file libstdc.orig/stdio/printf.c libstdc/stdio/printf.c
---- libstdc.orig/stdio/printf.c        2017-01-19 02:19:04.339168949 +1100
-+++ libstdc/stdio/printf.c     2017-01-19 02:19:04.351169187 +1100
+--- libstdc.orig/stdio/printf.c        2017-01-19 15:17:46.190529992 +1100
++++ libstdc/stdio/printf.c     2017-01-19 15:17:46.202529984 +1100
 @@ -1,11 +1,35 @@
 +/*
 + * Copyright (c) 1987 Regents of the University of California.
@@ -648,21 +1007,21 @@ diff --unified --recursive --new-file libstdc.orig/stdio/printf.c libstdc/stdio/
 +printf(fmt, va_alist)
 +      char *fmt;
 +      va_dcl {
-+      va_list ap;
++      va_list argp;
 +      int len;
  
 -printf(fmt, args)
 -char *fmt; {
 -      _doprnt(fmt, &args, stdout);
 -      return(ferror(stdout)? EOF: 0);
-+      va_start(ap);
-+      len = _doprnt(fmt, ap, stdout);
-+      va_end(ap);
++      va_start(argp);
++      len = _doprnt(fmt, argp, stdout);
++      va_end(argp);
 +      return(ferror(stdout) ? EOF : len);
  }
 diff --unified --recursive --new-file libstdc.orig/stdio/scanf.c libstdc/stdio/scanf.c
---- libstdc.orig/stdio/scanf.c 2017-01-19 02:19:04.339168949 +1100
-+++ libstdc/stdio/scanf.c      2017-01-19 02:19:04.351169187 +1100
+--- libstdc.orig/stdio/scanf.c 2017-01-19 15:17:46.190529992 +1100
++++ libstdc/stdio/scanf.c      2017-01-19 15:17:46.202529984 +1100
 @@ -2,29 +2,50 @@
  static char sccsid[] = "@(#)scanf.c   5.2 (Berkeley) 3/9/86";
  #endif
@@ -677,12 +1036,12 @@ diff --unified --recursive --new-file libstdc.orig/stdio/scanf.c libstdc/stdio/s
 +scanf(fmt, va_alist)
 +char *fmt;
 +va_dcl {
-+      va_list ap;
++      va_list argp;
 +      int len;
 +
-+      va_start(ap);
-+      len = _doscan(stdin, fmt, &args);
-+      va_end(ap);
++      va_start(argp);
++      len = _doscan(stdin, fmt, argp);
++      va_end(argp);
 +      return len;
  }
  
@@ -693,12 +1052,12 @@ diff --unified --recursive --new-file libstdc.orig/stdio/scanf.c libstdc/stdio/s
 -      return(_doscan(iop, fmt, &args));
 +char *fmt;
 +va_dcl {
-+      va_list ap;
++      va_list argp;
 +      int len;
 +
-+      va_start(ap);
-+      len = _doscan(iop, fmt, &args);
-+      va_end(ap);
++      va_start(argp);
++      len = _doscan(iop, fmt, argp);
++      va_end(argp);
 +      return len;
  }
  
@@ -709,10 +1068,10 @@ diff --unified --recursive --new-file libstdc.orig/stdio/scanf.c libstdc/stdio/s
 +char *fmt;
 +va_dcl {
        FILE _strbuf;
-+      va_list ap;
++      va_list argp;
 +      int len;
  
-+      va_start(ap);
++      va_start(argp);
        _strbuf._flag = _IOREAD|_IOSTRG;
        _strbuf._ptr = _strbuf._base = str;
        _strbuf._cnt = 0;
@@ -720,13 +1079,13 @@ diff --unified --recursive --new-file libstdc.orig/stdio/scanf.c libstdc/stdio/s
                _strbuf._cnt++;
        _strbuf._bufsiz = _strbuf._cnt;
 -      return(_doscan(&_strbuf, fmt, &args));
-+      len = _doscan(&_strbuf, fmt, &args);
-+      va_end(ap);
++      len = _doscan(&_strbuf, fmt, argp);
++      va_end(argp);
 +      return len;
  }
 diff --unified --recursive --new-file libstdc.orig/stdio/sprintf.c libstdc/stdio/sprintf.c
---- libstdc.orig/stdio/sprintf.c       2017-01-19 02:19:04.339168949 +1100
-+++ libstdc/stdio/sprintf.c    2017-01-19 02:19:04.351169187 +1100
+--- libstdc.orig/stdio/sprintf.c       2017-01-19 15:17:46.190529992 +1100
++++ libstdc/stdio/sprintf.c    2017-01-19 15:17:46.202529984 +1100
 @@ -1,17 +1,40 @@
 +/*
 + * Copyright (c) 1987 Regents of the University of California.
@@ -759,25 +1118,25 @@ diff --unified --recursive --new-file libstdc.orig/stdio/sprintf.c libstdc/stdio
 +sprintf(str, fmt, va_alist)
 +      char *str, *fmt;
 +      va_dcl {
-+      va_list ap;
++      va_list argp;
        FILE _strbuf;
 +      int len;
  
-+      va_start(ap);
++      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, ap, &_strbuf);
++      len = _doprnt(fmt, argp, &_strbuf);
 +      *_strbuf._ptr = 0;
-+      va_end(ap);
++      va_end(argp);
 +      return(len);
  }
 diff --unified --recursive --new-file libstdc.orig/stdio/vfprintf.c libstdc/stdio/vfprintf.c
 --- libstdc.orig/stdio/vfprintf.c      1970-01-01 10:00:00.000000000 +1000
-+++ libstdc/stdio/vfprintf.c   2017-01-19 02:19:04.351169187 +1100
++++ libstdc/stdio/vfprintf.c   2017-01-19 15:17:46.202529984 +1100
 @@ -0,0 +1,46 @@
 +/*
 + * Copyright (c) 1988 Regents of the University of California.
@@ -804,30 +1163,30 @@ diff --unified --recursive --new-file libstdc.orig/stdio/vfprintf.c libstdc/stdi
 +#include <varargs.h>
 +
 +int
-+vfprintf(iop, fmt, ap)
++vfprintf(iop, fmt, argp)
 +      FILE *iop;
 +      char *fmt;
-+      va_list ap; {
++      va_list argp; {
 +      int len;
 +      char localbuf[BUFSIZ];
 +
 +      if (iop->_flag & _IONBF) {
 +              iop->_flag &= ~_IONBF;
 +              iop->_ptr = iop->_base = localbuf;
-+              len = _doprnt(fmt, ap, iop);
++              len = _doprnt(fmt, argp, iop);
 +              (void) fflush(iop);
 +              iop->_flag |= _IONBF;
 +              iop->_base = NULL;
 +              iop->_bufsiz = 0;
 +              iop->_cnt = 0;
 +      } else
-+              len = _doprnt(fmt, ap, iop);
++              len = _doprnt(fmt, argp, iop);
 +
 +      return (ferror(iop) ? EOF : len);
 +}
 diff --unified --recursive --new-file libstdc.orig/stdio/vprintf.c libstdc/stdio/vprintf.c
 --- libstdc.orig/stdio/vprintf.c       1970-01-01 10:00:00.000000000 +1000
-+++ libstdc/stdio/vprintf.c    2017-01-19 02:19:04.351169187 +1100
++++ libstdc/stdio/vprintf.c    2017-01-19 15:17:46.202529984 +1100
 @@ -0,0 +1,33 @@
 +/*
 + * Copyright (c) 1988 Regents of the University of California.
@@ -854,17 +1213,17 @@ diff --unified --recursive --new-file libstdc.orig/stdio/vprintf.c libstdc/stdio
 +#include <varargs.h>
 +
 +int
-+vprintf(fmt, ap)
++vprintf(fmt, argp)
 +      char *fmt;
-+      va_list ap; {
++      va_list argp; {
 +      int len;
 +
-+      len = _doprnt(fmt, ap, stdout);
++      len = _doprnt(fmt, argp, stdout);
 +      return (ferror(stdout) ? EOF : len);
 +}
 diff --unified --recursive --new-file libstdc.orig/stdio/vsprintf.c libstdc/stdio/vsprintf.c
 --- libstdc.orig/stdio/vsprintf.c      1970-01-01 10:00:00.000000000 +1000
-+++ libstdc/stdio/vsprintf.c   2017-01-19 02:19:04.351169187 +1100
++++ libstdc/stdio/vsprintf.c   2017-01-19 15:17:46.202529984 +1100
 @@ -0,0 +1,38 @@
 +/*
 + * Copyright (c) 1988 Regents of the University of California.
@@ -891,22 +1250,22 @@ diff --unified --recursive --new-file libstdc.orig/stdio/vsprintf.c libstdc/stdi
 +#include <varargs.h>
 +
 +int
-+vsprintf(str, fmt, ap)
++vsprintf(str, fmt, argp)
 +      char *str, *fmt;
-+      va_list ap; {
++      va_list argp; {
 +      FILE f;
 +      int len;
 +
 +      f._flag = _IOWRT+_IOSTRG;
 +      f._ptr = str;
 +      f._cnt = 32767;
-+      len = _doprnt(fmt, ap, &f);
++      len = _doprnt(fmt, argp, &f);
 +      *f._ptr = 0;
 +      return (len);
 +}
 diff --unified --recursive --new-file libstdc.orig/stdio.h libstdc/stdio.h
---- libstdc.orig/stdio.h       2017-01-19 02:19:04.343169028 +1100
-+++ libstdc/stdio.h    2017-01-19 02:19:04.351169187 +1100
+--- libstdc.orig/stdio.h       2017-01-19 15:17:46.190529992 +1100
++++ libstdc/stdio.h    2017-01-19 15:17:46.202529984 +1100
 @@ -59,7 +59,7 @@
  long  ftell();
  char  *fgets();
@@ -917,8 +1276,8 @@ diff --unified --recursive --new-file libstdc.orig/stdio.h libstdc/stdio.h
  #endif
  # endif
 diff --unified --recursive --new-file libstdc.orig/sys/dir.h libstdc/sys/dir.h
---- libstdc.orig/sys/dir.h     2017-01-19 02:19:04.347169107 +1100
-+++ libstdc/sys/dir.h  2017-01-19 02:19:04.351169187 +1100
+--- libstdc.orig/sys/dir.h     2017-01-19 15:17:46.194529989 +1100
++++ libstdc/sys/dir.h  2017-01-19 15:17:46.202529984 +1100
 @@ -32,9 +32,9 @@
   * dp->d_ino set to 0.
   */
@@ -932,9 +1291,30 @@ diff --unified --recursive --new-file libstdc.orig/sys/dir.h libstdc/sys/dir.h
  #define DIRBLKSIZ     DEV_BSIZE
  #define       MAXNAMLEN       255
  
+diff --unified --recursive --new-file libstdc.orig/sys/isatty.c libstdc/sys/isatty.c
+--- libstdc.orig/sys/isatty.c  1970-01-01 10:00:00.000000000 +1000
++++ libstdc/sys/isatty.c       2017-01-19 15:17:46.202529984 +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 libstdc.orig/sys/param.h libstdc/sys/param.h
---- libstdc.orig/sys/param.h   2017-01-19 02:19:04.343169028 +1100
-+++ libstdc/sys/param.h        2017-01-19 02:19:04.351169187 +1100
+--- libstdc.orig/sys/param.h   2017-01-19 15:17:46.190529992 +1100
++++ libstdc/sys/param.h        2017-01-19 15:17:46.202529984 +1100
 @@ -53,15 +53,16 @@
  /*
   * Signals
@@ -981,8 +1361,8 @@ diff --unified --recursive --new-file libstdc.orig/sys/param.h libstdc/sys/param
 +/* moved this from sys/types.h */
 +#define       NBBY    8               /* number of bits in a byte */
 diff --unified --recursive --new-file libstdc.orig/sys/proc.h libstdc/sys/proc.h
---- libstdc.orig/sys/proc.h    2017-01-19 02:19:04.343169028 +1100
-+++ libstdc/sys/proc.h 2017-01-19 02:19:04.351169187 +1100
+--- libstdc.orig/sys/proc.h    2017-01-19 15:17:46.194529989 +1100
++++ libstdc/sys/proc.h 2017-01-19 15:17:46.202529984 +1100
 @@ -117,3 +117,8 @@
  #define       SSEL    0x0400000       /* selecting; wakeup/waiting danger */
  #define       SLOGIN  0x0800000       /* a login process (legit child of init) */
@@ -994,7 +1374,7 @@ diff --unified --recursive --new-file libstdc.orig/sys/proc.h libstdc/sys/proc.h
 +       ((p)->p_sig &~ ((p)->p_sigignore | (p)->p_sigmask))) && issig())
 diff --unified --recursive --new-file libstdc.orig/sys/select.h libstdc/sys/select.h
 --- libstdc.orig/sys/select.h  1970-01-01 10:00:00.000000000 +1000
-+++ libstdc/sys/select.h       2017-01-19 02:19:04.351169187 +1100
++++ libstdc/sys/select.h       2017-01-19 15:17:46.202529984 +1100
 @@ -0,0 +1,28 @@
 +#include <sys/param.h>
 +
@@ -1025,8 +1405,8 @@ diff --unified --recursive --new-file libstdc.orig/sys/select.h libstdc/sys/sele
 +#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 libstdc.orig/sys/tty.h libstdc/sys/tty.h
---- libstdc.orig/sys/tty.h     2017-01-19 02:19:04.343169028 +1100
-+++ libstdc/sys/tty.h  2017-01-19 02:20:23.760656935 +1100
+--- libstdc.orig/sys/tty.h     2017-01-19 15:17:46.190529992 +1100
++++ libstdc/sys/tty.h  2017-01-19 15:17:46.202529984 +1100
 @@ -70,20 +70,22 @@
        struct  ttychars t_chars;       /* tty */
        struct  winsize t_winsize;      /* window size */
@@ -1065,8 +1445,8 @@ diff --unified --recursive --new-file libstdc.orig/sys/tty.h libstdc/sys/tty.h
  
  #define       TTIPRI  28
 diff --unified --recursive --new-file libstdc.orig/sys/types.h libstdc/sys/types.h
---- libstdc.orig/sys/types.h   2017-01-19 02:19:04.343169028 +1100
-+++ libstdc/sys/types.h        2017-01-19 02:19:04.355169266 +1100
+--- libstdc.orig/sys/types.h   2017-01-19 15:17:46.194529989 +1100
++++ libstdc/sys/types.h        2017-01-19 15:17:46.202529984 +1100
 @@ -45,30 +45,32 @@
  typedef       u_short uid_t;
  typedef       u_short gid_t;
@@ -1117,8 +1497,8 @@ diff --unified --recursive --new-file libstdc.orig/sys/types.h libstdc/sys/types
  
  #endif
 diff --unified --recursive --new-file libstdc.orig/sys/vmmac.h libstdc/sys/vmmac.h
---- libstdc.orig/sys/vmmac.h   2017-01-19 02:19:04.343169028 +1100
-+++ libstdc/sys/vmmac.h        2017-01-19 02:19:04.355169266 +1100
+--- libstdc.orig/sys/vmmac.h   2017-01-19 15:17:46.194529989 +1100
++++ libstdc/sys/vmmac.h        2017-01-19 15:17:46.202529984 +1100
 @@ -157,3 +157,10 @@
        } \
        c->c_lock = 0; \
@@ -1131,8 +1511,8 @@ diff --unified --recursive --new-file libstdc.orig/sys/vmmac.h libstdc/sys/vmmac
 +#define       mapin(pte, v, pfnum, count, prot) \
 +      (*(int *)(pte) = (pfnum) | (prot), mtpr(TBIS, ptob(v)))
 diff --unified --recursive --new-file libstdc.orig/vax/vmparam.h libstdc/vax/vmparam.h
---- libstdc.orig/vax/vmparam.h 2017-01-19 02:19:04.347169107 +1100
-+++ libstdc/vax/vmparam.h      2017-01-19 02:19:04.355169266 +1100
+--- libstdc.orig/vax/vmparam.h 2017-01-19 15:17:46.194529989 +1100
++++ libstdc/vax/vmparam.h      2017-01-19 15:17:46.202529984 +1100
 @@ -156,5 +156,6 @@
  /*
   * BEWARE THIS DEFINITION WORKS ONLY WITH COUNT OF 1
diff --git a/lib/libstdc/mkpatch.sh b/lib/libstdc/mkpatch.sh
new file mode 100755 (executable)
index 0000000..8fddadd
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/sh
+(cd ..; diff --unified --recursive --new-file libstdc.orig libstdc) >a
+mv libstdc.patch libstdc.patch.bak
+mv a libstdc.patch
+wc -l libstdc.patch libstdc.patch.bak
diff --git a/lib/libstdc/mp.h b/lib/libstdc/mp.h
deleted file mode 100644 (file)
index a1539d1..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-#ifndef _MP_H_
-#define _MP_H_
-
-#include <gen.h>
-#include <stdio.h>
-
-/*
- * 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
-
-#endif
index 1e99b3e..314ad04 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-rm -rf *.c *.h *.o *.orig *.[ch].nocomm *.[ch].protos *.[ch].protos.nocomm *.[ch].usedby *.[ch].uses arpa compat-4.1 compat-sys5 csu gen inet machine net netimp netinet netns ns pascal protocols stdio sys temp.c vax vaxif vaxmba vaxuba xx*
+rm -rf *.c *.h *.o *.orig *.[ch].nocomm *.[ch].protos *.[ch].protos.nocomm *.temp.c *.[ch].usedby *.[ch].uses arpa compat-4.1 compat-sys5 csu gen inet machine net netimp netinet netns ns pascal protocols stdio sys vax vaxif vaxmba vaxuba xx*
 
 find ../libc \( -name '*.[cs]' -o -name Makefile \) -print |\
 sed -e 's:^\.\./libc/::' |\
@@ -69,6 +69,7 @@ do
     fi
   fi
 done
+sed -e 's/fork/vfork/g' <sys/fork.c >sys/vfork.c
 
 find vax -name Makefile -print |\
 while read i
@@ -76,8 +77,11 @@ do
   rm $i
 done
 
-find vax -type f -print >unported.txt
-rm -rf vax
+(
+  find csu -type f -print
+  find vax -type f -print
+) >unported.txt
+rm -r csu vax
 
 find ../../include -name '*.h' -print |\
 sed -e 's:^\.\./\.\./include/::' |\
@@ -87,6 +91,9 @@ do
   cp ../../include/$i $i
 done
 
+echo mp.h >>unported.txt
+rm mp.h
+
 find ../../sys/h -name '*.h' -print |\
 sed -e 's:^\.\./\.\./sys/h/::' |\
 while read i
index a0ec217..55d7a39 100644 (file)
@@ -4,22 +4,24 @@
 #include <arpa/nameser.h>
 #include <netdb.h>
 #include <stdio.h>
+#include <sys/types.h>
 
 /* formerly duplicated in netinet/in.h and netns/ns.h */
-#if !defined(vax) && !defined(ntohl) && !defined(lint)
+/* confuses cproto which thinks #define names are types or type modifiers */
+/*#if !defined(vax) && !defined(ntohl) && !defined(lint)*/
 /*
  * Macros for number representation conversion.
  */
-#define        ntohl(x)        (x)
-#define        ntohs(x)        (x)
-#define        htonl(x)        (x)
-#define        htons(x)        (x)
-#endif
+/*#define      ntohl(x)        (x)*/
+/*#define      ntohs(x)        (x)*/
+/*#define      htonl(x)        (x)*/
+/*#define      htons(x)        (x)*/
+/*#endif*/
 
-#if !defined(ntohl) && (defined(vax) || defined(lint))
+/*#if !defined(ntohl) && (defined(vax) || defined(lint))*/
 /*u_short      ntohs(), htons();*/
 /*u_long       ntohl(), htonl();*/
-#endif
+/*#endif*/
 
 #ifndef KERNEL
 #ifndef __P
 #endif
 #endif
 
+/* net/htonl.c */
+u_long htonl __P((u_long hostlong));
+
+/* net/htons.c */
+u_short htons __P((int hostshort));
+
+/* net/ntohl.c */
+u_long ntohl __P((u_long netlong));
+
+/* net/ntohs.c */
+u_short ntohs __P((int netshort));
+
 /* net/rcmd.c */
 int rcmd __P((char **ahost, int rport, char *locuser, char *remuser, char *cmd, int *fd2p));
 int rresvport __P((int *alport));
@@ -41,9 +55,9 @@ int _checkhost __P((char *rhost, char *lhost, int len));
 int rexec __P((char **ahost, int rport, char *name, char *pass, char *cmd, int *fd2p));
 
 /* net/ruserpass.c */
-int ruserpass __P((char *host, char **aname, char **apass));
-int mkpwunclear __P((char *spasswd, int mch, char *sencpasswd));
-int mkpwclear __P((char *sencpasswd, int mch, char *spasswd));
+void ruserpass __P((char *host, char **aname, char **apass));
+void mkpwunclear __P((char *spasswd, int mch, char *sencpasswd));
+void mkpwclear __P((char *sencpasswd, int mch, char *spasswd));
 #endif
 
 #endif
index 8233575..38b3904 100644 (file)
@@ -10,7 +10,7 @@
 static char sccsid[] = "@(#)getnetbyaddr.c     5.3 (Berkeley) 5/19/86";
 #endif
 
-#include <netdb.h>
+/*#include <netdb.h>*/
 
 extern int _net_stayopen;
 
index e09de4b..e328218 100644 (file)
@@ -11,7 +11,7 @@
 static char sccsid[] = "@(#)getnetbyname.c     5.3 (Berkeley) 5/19/86";
 #endif
 
-#include <netdb.h>
+/*#include <netdb.h>*/
 
 extern int _net_stayopen;
 
index 3a8bd49..0cd6dfd 100644 (file)
 static char sccsid[] = "@(#)getnetent.c        5.3 (Berkeley) 5/19/86";
 #endif
 
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netdb.h>
-#include <ctype.h>
+/*#include <stdio.h>*/
+/*#include <sys/types.h>*/
+/*#include <sys/socket.h>*/
+/*#include <netdb.h>*/
+/*#include <ctype.h>*/
 
 #define        MAXALIASES      35
 
index be04feb..2e3b13b 100644 (file)
@@ -10,7 +10,7 @@
 static char sccsid[] = "@(#)getproto.c 5.3 (Berkeley) 5/19/86";
 #endif
 
-#include <netdb.h>
+/*#include <netdb.h>*/
 
 extern int _proto_stayopen;
 
index 166e65e..4ec4e7a 100644 (file)
 static char sccsid[] = "@(#)getprotoent.c      5.3 (Berkeley) 5/19/86";
 #endif
 
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netdb.h>
-#include <ctype.h>
+/*#include <stdio.h>*/
+/*#include <sys/types.h>*/
+/*#include <sys/socket.h>*/
+/*#include <netdb.h>*/
+/*#include <ctype.h>*/
 
 #define        MAXALIASES      35
 
index 01cc11c..7223866 100644 (file)
@@ -11,7 +11,7 @@
 static char sccsid[] = "@(#)getprotoname.c     5.3 (Berkeley) 5/19/86";
 #endif
 
-#include <netdb.h>
+/*#include <netdb.h>*/
 
 extern int _proto_stayopen;
 
index 733d9fb..3ac46d2 100644 (file)
@@ -11,7 +11,7 @@
 static char sccsid[] = "@(#)getservbyname.c    5.3 (Berkeley) 5/19/86";
 #endif
 
-#include <netdb.h>
+/*#include <netdb.h>*/
 
 extern int _serv_stayopen;
 
index 2529922..71b9720 100644 (file)
@@ -11,7 +11,7 @@
 static char sccsid[] = "@(#)getservbyport.c    5.3 (Berkeley) 5/19/86";
 #endif
 
-#include <netdb.h>
+/*#include <netdb.h>*/
 
 extern int _serv_stayopen;
 
index a227c4e..8bc3121 100644 (file)
@@ -1,6 +1,6 @@
 #include <gen.h>
-#include <netdb.h>
 #include <net.h>
+#include <netdb.h>
 #include <stdio.h>
 #include <sys/types.h>
 
 static char sccsid[] = "@(#)getservent.c       5.3 (Berkeley) 5/19/86";
 #endif
 
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netdb.h>
-#include <ctype.h>
+/*#include <stdio.h>*/
+/*#include <sys/types.h>*/
+/*#include <sys/socket.h>*/
+/*#include <netdb.h>*/
+/*#include <ctype.h>*/
 
 #define        MAXALIASES      35
 
index 1578a41..b6b4778 100644 (file)
 static char sccsid[] = "@(#)gethostent.c       5.3 (Berkeley) 3/9/86";
 #endif
 
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netdb.h>
-#include <ctype.h>
-#include <ndbm.h>
+/*#include <stdio.h>*/
+/*#include <sys/types.h>*/
+/*#include <sys/socket.h>*/
+/*#include <netdb.h>*/
+/*#include <ctype.h>*/
+/*#include <ndbm.h>*/
 
 /*
  * Internet version.
index abea174..18eeff6 100644 (file)
 static char sccsid[] = "@(#)gethostnamadr.c    5.5 (Berkeley) 3/9/86";
 #endif
 
-#include <stdio.h>
-#include <netdb.h>
-#include <sys/file.h>
-#include <ndbm.h>
-#include <ctype.h>
+/*#include <stdio.h>*/
+/*#include <netdb.h>*/
+/*#include <sys/file.h>*/
+/*#include <ndbm.h>*/
+/*#include <ctype.h>*/
 
 #define        MAXALIASES      35
 
index 25d3560..b19b4d6 100644 (file)
@@ -2,7 +2,6 @@
 #include <net.h>
 #include <sys/types.h>
 
-/*#include <net.h>*/
 /*#include <sys/types.h>*/
 u_long htonl(hostlong) u_long hostlong; {
   abort();
index f56e85f..d791a01 100644 (file)
@@ -2,8 +2,7 @@
 #include <net.h>
 #include <sys/types.h>
 
-/*#include <net.h>*/
 /*#include <sys/types.h>*/
-u_short htons(hostshort) u_short hostshort; {
+u_short htons(hostshort) int hostshort; {
   abort();
 }
index 4b4e4d2..fe1b225 100644 (file)
@@ -2,8 +2,8 @@
 #include <arpa/nameser.h>
 #include <ctype.h>
 #include <gen.h>
-#include <netdb.h>
 #include <net.h>
+#include <netdb.h>
 #include <netinet/in.h>
 #include <resolv.h>
 #include <stdio.h>
 static char sccsid[] = "@(#)gethostnamadr.c    6.12 (Berkeley) 5/19/86";
 #endif
 
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <ctype.h>
-#include <netdb.h>
-#include <stdio.h>
-#include <errno.h>
-#include <arpa/inet.h>
-#include <arpa/nameser.h>
-#include <resolv.h>
+/*#include <sys/types.h>*/
+/*#include <sys/socket.h>*/
+/*#include <netinet/in.h>*/
+/*#include <ctype.h>*/
+/*#include <netdb.h>*/
+/*#include <stdio.h>*/
+/*#include <errno.h>*/
+/*#include <arpa/inet.h>*/
+/*#include <arpa/nameser.h>*/
+/*#include <resolv.h>*/
 
 #define        MAXALIASES      35
 #define MAXADDRS       35
index 9244907..53c7385 100644 (file)
 static char sccsid[] = "@(#)sethostent.c       6.3 (Berkeley) 4/10/86";
 #endif
 
-#include <sys/types.h>
-#include <arpa/nameser.h>
-#include <netinet/in.h>
-#include <resolv.h>
+/*#include <sys/types.h>*/
+/*#include <arpa/nameser.h>*/
+/*#include <netinet/in.h>*/
+/*#include <resolv.h>*/
 
 int sethostent(stayopen) int stayopen; {
        if (stayopen)
index ba34706..8caa668 100644 (file)
@@ -2,7 +2,6 @@
 #include <net.h>
 #include <sys/types.h>
 
-/*#include <net.h>*/
 /*#include <sys/types.h>*/
 u_long ntohl(netlong) u_long netlong; {
   abort();
index 6471fe8..4546299 100644 (file)
@@ -2,8 +2,7 @@
 #include <net.h>
 #include <sys/types.h>
 
-/*#include <net.h>*/
 /*#include <sys/types.h>*/
-u_short ntohs(netshort) u_short netshort; {
+u_short ntohs(netshort) int netshort; {
   abort();
 }
index 8373d55..32daf13 100644 (file)
@@ -1,15 +1,15 @@
 #include <arpa/inet.h>
 #include <ctype.h>
 #include <gen.h>
-#include <netdb.h>
 #include <net.h>
+#include <netdb.h>
 #include <netinet/in.h>
 #include <pwd.h>
 #include <stdio.h>
 #include <strings.h>
+#include <sys.h>
 #include <sys/errno.h>
 #include <sys/file.h>
-#include <sys.h>
 #include <sys/param.h>
 #include <sys/proc.h>
 #include <sys/signal.h>
 static char sccsid[] = "@(#)rcmd.c     5.11 (Berkeley) 5/6/86";
 #endif
 
-#include <stdio.h>
-#include <ctype.h>
-#include <pwd.h>
-#include <sys/param.h>
-#include <sys/file.h>
-#include <sys/signal.h>
-#include <sys/socket.h>
-#include <sys/stat.h>
+/*#include <stdio.h>*/
+/*#include <ctype.h>*/
+/*#include <pwd.h>*/
+/*#include <sys/param.h>*/
+/*#include <sys/file.h>*/
+/*#include <sys/signal.h>*/
+/*#include <sys/socket.h>*/
+/*#include <sys/stat.h>*/
 
-#include <netinet/in.h>
+/*#include <netinet/in.h>*/
 
-#include <netdb.h>
-#include <errno.h>
+/*#include <netdb.h>*/
+/*#include <errno.h>*/
 
 extern errno;
 /*char *index(), *sprintf();*/
index 21641b6..b388a0c 100644 (file)
@@ -11,9 +11,9 @@
 static char sccsid[] = "@(#)res_comp.c 6.7 (Berkeley) 3/11/86";
 #endif
 
-#include <sys/types.h>
-#include <stdio.h>
-#include <arpa/nameser.h>
+/*#include <sys/types.h>*/
+/*#include <stdio.h>*/
+/*#include <arpa/nameser.h>*/
 
 /*
  * Expand compressed domain name 'comp_dn' to full domain name.
index 0228cdc..36d6386 100644 (file)
@@ -20,10 +20,10 @@ static char sccsid[] = "@(#)res_debug.c     5.13 (Berkeley) 3/9/86";
 #define DEBUG
 #endif
 
-#include <sys/types.h>
-#include <netinet/in.h>
-#include <stdio.h>
-#include <arpa/nameser.h>
+/*#include <sys/types.h>*/
+/*#include <netinet/in.h>*/
+/*#include <stdio.h>*/
+/*#include <arpa/nameser.h>*/
 
 /*extern char *p_cdname(), *p_rr(), *p_type(), *p_class();*/
 /*extern char *inet_ntoa();*/
index 957f20e..cce3cf2 100644 (file)
 static char sccsid[] = "@(#)res_init.c 6.5 (Berkeley) 4/11/86";
 #endif
 
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <stdio.h>
-#include <arpa/nameser.h>
-#include <resolv.h>
+/*#include <sys/types.h>*/
+/*#include <sys/socket.h>*/
+/*#include <netinet/in.h>*/
+/*#include <stdio.h>*/
+/*#include <arpa/nameser.h>*/
+/*#include <resolv.h>*/
 
 /*
  * Resolver configuration file. Contains the address of the
index 0f4e2ac..01ecb96 100644 (file)
 static char sccsid[] = "@(#)res_mkquery.c      6.3 (Berkeley) 3/17/86";
 #endif
 
-#include <stdio.h>
-#include <sys/types.h>
-#include <netinet/in.h>
-#include <arpa/nameser.h>
-#include <resolv.h>
+/*#include <stdio.h>*/
+/*#include <sys/types.h>*/
+/*#include <netinet/in.h>*/
+/*#include <arpa/nameser.h>*/
+/*#include <resolv.h>*/
 
 /*extern       char *sprintf();*/
 
index d4c87a7..8ca652d 100644 (file)
@@ -26,15 +26,15 @@ static char sccsid[] = "@(#)res_send.c      6.14 (Berkeley) 7/2/86";
  * Send query to name server and wait for reply.
  */
 
-#include <sys/param.h>
-#include <sys/time.h>
-#include <sys/socket.h>
-#include <sys/uio.h>
-#include <netinet/in.h>
-#include <stdio.h>
-#include <errno.h>
-#include <arpa/nameser.h>
-#include <resolv.h>
+/*#include <sys/param.h>*/
+/*#include <sys/time.h>*/
+/*#include <sys/socket.h>*/
+/*#include <sys/uio.h>*/
+/*#include <netinet/in.h>*/
+/*#include <stdio.h>*/
+/*#include <errno.h>*/
+/*#include <arpa/nameser.h>*/
+/*#include <resolv.h>*/
 
 extern int errno;
 
index b5e2c9e..a6a05c4 100644 (file)
@@ -1,6 +1,6 @@
 #include <gen.h>
-#include <netdb.h>
 #include <net.h>
+#include <netdb.h>
 #include <netinet/in.h>
 #include <stdio.h>
 #include <strings.h>
 static char sccsid[] = "@(#)rexec.c    5.2 (Berkeley) 3/9/86";
 #endif
 
-#include <sys/types.h>
-#include <sys/socket.h>
+/*#include <sys/types.h>*/
+/*#include <sys/socket.h>*/
 
-#include <netinet/in.h>
+/*#include <netinet/in.h>*/
 
-#include <stdio.h>
-#include <netdb.h>
-#include <errno.h>
+/*#include <stdio.h>*/
+/*#include <netdb.h>*/
+/*#include <errno.h>*/
 
 extern errno;
 /*char *index(), *sprintf();*/
index a83af5a..abb9458 100644 (file)
@@ -1,4 +1,3 @@
-#include <csu.h>
 #include <ctype.h>
 #include <gen.h>
 #include <net.h>
 static char sccsid[] = "@(#)ruserpass.c        5.2 (Berkeley) 3/9/86";
 #endif
 
-#include <stdio.h>
-#include <utmp.h>
-#include <ctype.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <errno.h>
+/*#include <stdio.h>*/
+/*#include <utmp.h>*/
+/*#include <ctype.h>*/
+/*#include <sys/types.h>*/
+/*#include <sys/stat.h>*/
+/*#include <errno.h>*/
 
 /*char *renvlook(), *malloc(), *index(), *getenv(), *getpass(), *getlogin();*/
 /*struct       utmp *getutmp();*/
 static FILE *cfile;
 
-static renv __P((char *host, char **aname, char **apass));
+static void renv __P((char *host, char **aname, char **apass));
 static char *renvlook __P((char *host));
-static rnetrc __P((char *host, char **aname, char **apass));
+static void rnetrc __P((char *host, char **aname, char **apass));
 static token __P((void));
 static char *nbsencrypt __P((char *str, char *key, char *result));
 static char *nbsdecrypt __P((char *cpt, char *key, char *result));
@@ -43,13 +42,13 @@ static enblkclr __P((char *blk, char *str));
 static char *deblkclr __P((char *blk));
 static enblknot __P((char *blk, char *crp));
 static char *deblknot __P((char *blk));
-static nbssetkey __P((char *key));
-static blkencrypt __P((char *block, int edflag));
+static void nbssetkey __P((char *key));
+static void blkencrypt __P((char *block, int edflag));
 static struct utmp *getutmp __P((char *sttyname));
-static sreverse __P((register char *sto, register char *sfrom));
+static void sreverse __P((register char *sto, register char *sfrom));
 static char *mkenvkey __P((int mch));
 
-int ruserpass(host, aname, apass) char *host; char **aname; char **apass; {
+void ruserpass(host, aname, apass) char *host; char **aname; char **apass; {
 
        renv(host, aname, apass);
        if (*aname == 0 || *apass == 0)
@@ -74,7 +73,7 @@ int ruserpass(host, aname, apass) char *host; char **aname; char **apass; {
        }
 }
 
-static renv(host, aname, apass) char *host; char **aname; char **apass; {
+static void renv(host, aname, apass) char *host; char **aname; char **apass; {
        register char *cp;
        char *stemp, fgetlogin, *comma;
 
@@ -149,7 +148,7 @@ static struct toktab {
        0,              0
 };
 
-static rnetrc(host, aname, apass) char *host; char **aname; char **apass; {
+static void rnetrc(host, aname, apass) char *host; char **aname; char **apass; {
        char *hdir, buf[BUFSIZ];
        int t;
        struct stat stb;
@@ -484,7 +483,7 @@ static      char    KS[16][48];
  * Set up the key schedule from the key.
  */
 
-static nbssetkey(key) char *key; {
+static void nbssetkey(key) char *key; {
        register i, j, k;
        int t;
 
@@ -605,7 +604,7 @@ static      char    preS[48];
  * The payoff: encrypt a block.
  */
 
-static blkencrypt(block, edflag) char *block; int edflag; {
+static void blkencrypt(block, edflag) char *block; int edflag; {
        int i, ii;
        register t, j, k;
 
@@ -715,7 +714,7 @@ static struct utmp *getutmp(sttyname) char *sttyname; {
        return(NULL);
 }
 
-static sreverse(sto, sfrom) register char *sto; register char *sfrom; {
+static void sreverse(sto, sfrom) register char *sto; register char *sfrom; {
        register int i;
 
        i = strlen(sfrom);
@@ -754,7 +753,7 @@ static char *mkenvkey(mch) int mch; {
        return (skey);
 }
 
-int mkpwunclear(spasswd, mch, sencpasswd) char *spasswd; int mch; char *sencpasswd; {
+void mkpwunclear(spasswd, mch, sencpasswd) char *spasswd; int mch; char *sencpasswd; {
        register char *skey;
 
        if (spasswd[0] == 0) {
@@ -769,7 +768,7 @@ int mkpwunclear(spasswd, mch, sencpasswd) char *spasswd; int mch; char *sencpass
        nbsencrypt(spasswd, skey, sencpasswd);
 }
 
-int mkpwclear(sencpasswd, mch, spasswd) char *sencpasswd; int mch; char *spasswd; {
+void mkpwclear(sencpasswd, mch, spasswd) char *sencpasswd; int mch; char *spasswd; {
        register char *skey;
 
        if (sencpasswd[0] == 0) {
index fb3d97a..7cba51c 100644 (file)
@@ -1,8 +1,8 @@
 #ifndef _NETINET_IF_ETHER_H_
 #define _NETINET_IF_ETHER_H_
 
-#include <net/if_arp.h>
 #include <net/if.h>
+#include <net/if_arp.h>
 #include <netinet/in.h>
 #include <sys/types.h>
 
index 693202e..8678eab 100644 (file)
@@ -1,8 +1,8 @@
 #ifndef _NETINET_IN_PCB_H_
 #define _NETINET_IN_PCB_H_
 
-#include <netinet/in.h>
 #include <net/route.h>
+#include <netinet/in.h>
 #include <sys/types.h>
 
 /*
index 732fc08..7fd7d9b 100644 (file)
@@ -2,8 +2,8 @@
 #define _NETINET_TCP_DEBUG_H_
 
 #include <netinet/in_systm.h>
-#include <netinet/tcpip.h>
 #include <netinet/tcp_var.h>
+#include <netinet/tcpip.h>
 #include <sys/types.h>
 
 /*
index 2343846..ab46b82 100644 (file)
@@ -1,8 +1,8 @@
 #ifndef _NETNS_NS_PCB_H_
 #define _NETNS_NS_PCB_H_
 
-#include <netns/ns.h>
 #include <net/route.h>
+#include <netns/ns.h>
 #include <sys/types.h>
 
 /*
index 8fabb1c..330b55b 100644 (file)
 static char sccsid[] = "@(#)ns_addr.c  6.2 (Berkeley) 3/9/86";
 #endif
 
-#include <sys/types.h>
-#include <netns/ns.h>
+/*#include <sys/types.h>*/
+/*#include <netns/ns.h>*/
 
 static struct ns_addr addr, zero_addr;
 
-static Field __P((char *buf, u_char *out, int len));
+static void Field __P((char *buf, u_char *out, int len));
 static cvtbase __P((int oldbase, int newbase, int input[], int inlen, unsigned char result[], int reslen));
 
 struct ns_addr ns_addr(name) char *name; {
@@ -69,7 +69,7 @@ struct ns_addr ns_addr(name) char *name; {
        return (addr);
 }
 
-static Field(buf, out, len) char *buf; u_char *out; int len; {
+static void Field(buf, out, len) char *buf; u_char *out; int len; {
        register char *bp = buf;
        int i, ibase, base16 = 0, base10 = 0, clen = 0;
        int hb[6], *hp;
index 41ca351..8a0462b 100644 (file)
@@ -14,8 +14,8 @@
 static char sccsid[] = "@(#)ns_ntoa.c  6.3 (Berkeley) 3/9/86";
 #endif
 
-#include <sys/types.h>
-#include <netns/ns.h>
+/*#include <sys/types.h>*/
+/*#include <netns/ns.h>*/
 
 static char *spectHex __P((char *p0));
 
index 5fb37bc..9c0c1f8 100644 (file)
@@ -177,8 +177,6 @@ fstab.h:int setfsent();
 fstab.h:int    endfsent();
 net.h:u_short  ntohs(), htons();
 net.h:u_long   ntohl(), htonl();
-mp.h:extern MINT *itom();
-mp.h:extern short *xalloc();
 disktab.h:struct       disktab *getdiskbyname();
 strings.h:char *strcat();
 strings.h:char *strncat();
index 6bf6535..f4d9b2a 100755 (executable)
@@ -49,8 +49,9 @@ do
   csplit -b '%05d' -q $i '/^#[  ]*include[^0-9A-Za-z_]/' '{*}'
   for j in xx*
   do
-    sed -e 's/^#[       ]*include[      ]*\(<[^>]*>\|"[^"]*"\)/\/\*&\*\//' -i $j
-    if grep -v "^#[     ]*include[^0-9A-Za-z_]" $j |../../xify/nocomment |grep -q '[^   ]'
+    #sed -e 's/^#[      ]*include[      ]*\(<[^>]*>\|"[^"]*"\)/\/\*&\*\//' -i $j
+    sed -e 's/^#[       ]*include[      ]*<[^>]*>/\/\*&\*\//' -i $j
+    if grep -v "^#[     ]*include[^0-9A-Za-z_]" $j |sed -e '/^#[        ]*if.*SCCS/,/^#[        ]*endif/s/.*//' |../../xify/nocomment |grep -q '[^      ]'
     then
       break
     fi
@@ -63,6 +64,24 @@ sed -e 's:^\./::' |\
 while read i
 do
   echo "i=$i"
+
+  rm -f a
+  if test -s $i.uses
+  then
+    LC_ALL=C sort <$i.uses |uniq >a
+
+    pattern=
+    prefix=
+    for j in `cat a`
+    do
+      pattern="$pattern$prefix$j"
+      prefix='\|'
+    done
+    echo "pattern=$pattern"
+
+    sed -e "s:^#[       ]*include[      ]*\\(<\\($pattern\\)>\\|\"\\($pattern\\)\"\\):\\/\\*&\\*\\/:" -i $i
+  fi
+
   name=_`echo $i |tr '.\-/abcdefghijklmnopqrstuvwxyz' '___ABCDEFGHIJKLMNOPQRSTUVWXYZ'`_
   echo "name=$name"
   (
@@ -71,9 +90,9 @@ do
 #define $name
 
 EOF
-    if test -s $i.uses
+    if test -s a
     then
-      sort <$i.uses |uniq |sed -e 's/.*/#include <&>/; s/^#include <varargs.h>$/#ifdef __STDC__\n#include <stdarg.h>\n#endif/'
+      sed -e 's/.*/#include <&>/; s/^#include <varargs.h>$/#ifdef __STDC__\n#include <stdarg.h>\n#endif/' a
       echo
     fi
     cat $i
@@ -99,8 +118,8 @@ EOF
 
 #endif
 EOF
-  ) |../../xify/newline >a
-  mv a $i
+  ) |../../xify/newline >b
+  mv b $i
 done
 
 find . -name '*.c' -print |\
@@ -108,6 +127,7 @@ sed -e 's:^\./::' |\
 while read i
 do
   echo "i=$i"
+
   if test -s $i.protos && grep '^static ' $i.protos >a
   then
     pattern="`sed -ne '1{s/\*/\\\*/g; s/ __P((.*));/(/p}' $i.protos`"
@@ -123,13 +143,31 @@ do
     fi
     cat xx00 a >$i
   fi
+
+  rm -f a
+  if test -s $i.uses
+  then
+    LC_ALL=C sort <$i.uses |uniq >a
+
+    pattern=
+    prefix=
+    for j in `cat a`
+    do
+      pattern="$pattern$prefix$j"
+      prefix='\|'
+    done
+    echo "pattern=$pattern"
+
+    sed -e "s:^#[       ]*include[      ]*\\(<\\($pattern\\)>\\|\"\\($pattern\\)\"\\):\\/\\*&\\*\\/:" -i $i
+  fi
+  
   (
-    if test -s $i.uses
+    if test -s a
     then
-      sort <$i.uses |uniq |sed -e 's/.*/#include <&>/; s/^#include <varargs.h>$/#ifdef __STDC__\n#include <stdarg.h>\n#define _va_start(ap, arg) va_start(ap, arg)\n#else\n#include <varargs.h>\n#define _va_start(ap, arg) va_start(ap)\n#endif/'
+      sed -e 's/.*/#include <&>/; s/^#include <varargs.h>$/#ifdef __STDC__\n#include <stdarg.h>\n#define _va_start(argp, arg) va_start(argp, arg)\n#else\n#include <varargs.h>\n#define _va_start(argp, arg) va_start(argp)\n#endif/' a
       echo
     fi
-    sed -e 's/\([^0-9A-Za-z_]\)va_start(ap);/\1_va_start(ap, fmt);/' $i
-  ) |../../xify/newline >a
-  mv a $i
+    sed -e 's/\([^0-9A-Za-z_]\)va_start(argp);/\1_va_start(argp, fmt);/' $i
+  ) |../../xify/newline >b
+  mv b $i
 done
index 2fe77d3..44de0e2 100755 (executable)
@@ -22,7 +22,7 @@ sed -e 's:\./::' |\
 while read i
 do
   mkdir -p ../../x_include/`dirname $i`
-  ../../xify/xify <$i |sed -e 's/register x_int x_u_long/register x_u_long/g' >../../x_include/`dirname $i`/x_`basename $i`
+  ../../xify/xify.sh <$i >../../x_include/`dirname $i`/x_`basename $i`
 done
 
 find . -name '*.h' -print |\
@@ -30,9 +30,23 @@ sed -e 's:\./::' |\
 while read i
 do
   echo "i=$i"
-  echo "#include <$i>" |../../xify/xify >temp.c
+  name=`echo $i |tr '.\-/' '___'`
+  echo "name=$name"
+  echo "#include <$i>" |../../xify/xify.sh >$name.temp.c
   echo "===$i===" >&2
-  gcc -nostdinc -I../../x_include -Dx_vax -Dx_NCMD=1 -Dx_NRSP=1 -c temp.c
+  gcc -nostdinc -I../../x_include -Dx_vax -Dx_NCMD=1 -Dx_NRSP=1 -c $name.temp.c
+  rm $name.temp.c
 done
 
-rm -f temp.c errno.h fcntl.h frame.h machine signal.h syslog.h
+find . -name '*.c' -print |\
+sed -e 's:\./::' |\
+while read i
+do
+  echo "i=$i"
+  name=`echo $i |tr '.\-/' '___'`
+  echo "name=$name"
+  ../../xify/xify.sh <$i >$name.temp.c
+  echo "===$i===" >&2
+  gcc -nostdinc -I../../x_include -Dx_vax -c $name.temp.c
+  rm $name.temp.c
+done
index 2c42334..3d0b6f2 100644 (file)
@@ -88,7 +88,7 @@ int clearerr __P((register FILE *iop));
 int _doprnt __P((u_char *fmt0, va_list argp, register FILE *fp));
 
 /* stdio/doscan.c */
-int _doscan __P((FILE *iop, register char *fmt, register va_list ap));
+int _doscan __P((FILE *iop, register char *fmt, register va_list argp));
 
 /* stdio/exit.c */
 int exit __P((int code));
@@ -108,9 +108,9 @@ int _filbuf __P((register FILE *iop));
 /* stdio/findiop.c */
 FILE *_findiop __P((void));
 int _f_morefiles __P((void));
-int f_prealloc __P((void));
-int _fwalk __P((register int (*function)(void)));
-int _cleanup __P((void));
+void f_prealloc __P((void));
+void _fwalk __P((register int (*function)(void)));
+void _cleanup __P((void));
 
 /* stdio/flsbuf.c */
 int _flsbuf __P((int c, register FILE *iop));
@@ -194,13 +194,13 @@ int _strout __P((register count, register char *string, int adjust, register FIL
 int ungetc __P((int c, register FILE *iop));
 
 /* stdio/vfprintf.c */
-int vfprintf __P((FILE *iop, char *fmt, va_list ap));
+int vfprintf __P((FILE *iop, char *fmt, va_list argp));
 
 /* stdio/vprintf.c */
-int vprintf __P((char *fmt, va_list ap));
+int vprintf __P((char *fmt, va_list argp));
 
 /* stdio/vsprintf.c */
-int vsprintf __P((char *str, char *fmt, va_list ap));
+int vsprintf __P((char *str, char *fmt, va_list argp));
 #endif
 
 #endif
index dc11e4e..99234f3 100644 (file)
@@ -4,7 +4,7 @@
 static char sccsid[] = "@(#)clrerr.c   5.2 (Berkeley) 3/9/86";
 #endif
 
-#include <stdio.h>
+/*#include <stdio.h>*/
 #undef clearerr
 
 int clearerr(iop) register FILE *iop; {
index 67384db..8bab107 100644 (file)
@@ -7,10 +7,10 @@
 #include <sys/types.h>
 #ifdef __STDC__
 #include <stdarg.h>
-#define _va_start(ap, arg) va_start(ap, arg)
+#define _va_start(argp, arg) va_start(argp, arg)
 #else
 #include <varargs.h>
-#define _va_start(ap, arg) va_start(ap)
+#define _va_start(argp, arg) va_start(argp)
 #endif
 
 /*
 static char sccsid[] = "@(#)doprnt.c   5.35 (Berkeley) 6/27/88";
 #endif
 
-#include <sys/types.h>
-#include <varargs.h>
-#include <stdio.h>
-#include <ctype.h>
+/*#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
index a1ffe88..7a8f05d 100644 (file)
@@ -3,19 +3,19 @@
 #include <stdio.h>
 #ifdef __STDC__
 #include <stdarg.h>
-#define _va_start(ap, arg) va_start(ap, arg)
+#define _va_start(argp, arg) va_start(argp, arg)
 #else
 #include <varargs.h>
-#define _va_start(ap, arg) va_start(ap)
+#define _va_start(argp, arg) va_start(argp)
 #endif
 
 #if defined(LIBC_SCCS) && !defined(lint)
 static char sccsid[] = "@(#)doscan.c   5.2 (Berkeley) 3/9/86";
 #endif
 
-#include <stdio.h>
-#include <ctype.h>
-#include <varargs.h>
+/*#include <stdio.h>*/
+/*#include <ctype.h>*/
+/*#include <varargs.h>*/
 
 #define        SPC     01
 #define        STP     02
@@ -43,7 +43,7 @@ static _innum __P((int *ptr, int type, int len, int size, FILE *iop, int *eofptr
 static _instr __P((register char *ptr, int type, int len, register FILE *iop, int *eofptr));
 static char *_getccl __P((register unsigned char *s));
 
-int _doscan(iop, fmt, ap) FILE *iop; register char *fmt; register va_list ap; {
+int _doscan(iop, fmt, argp) FILE *iop; register char *fmt; register va_list argp; {
        register int ch;
        int nmatch, len, ch1;
        int *ptr, fileended, size;
@@ -58,7 +58,7 @@ int _doscan(iop, fmt, ap) FILE *iop; register char *fmt; register va_list ap; {
                        goto def;
                ptr = 0;
                if (ch != '*')
-                       ptr = va_arg(ap, int *);
+                       ptr = va_arg(argp, int *);
                else
                        ch = *fmt++;
                len = 0;
index f9ee999..54bf292 100644 (file)
@@ -1,4 +1,3 @@
-#include <csu.h>
 #include <gen.h>
 #include <stdio.h>
 #include <sys/proc.h>
index 3079a52..78b0148 100644 (file)
@@ -18,9 +18,9 @@ static char sccsid[] = "@(#)fdopen.c  5.2 (Berkeley) 3/9/86";
  * status
  */
 
-#include <sys/types.h>
-#include <sys/file.h>
-#include <stdio.h>
+/*#include <sys/types.h>*/
+/*#include <sys/file.h>*/
+/*#include <stdio.h>*/
 
 FILE *fdopen(fd, mode) int fd; register char *mode; {
        extern FILE *_findiop();
index 7a33d9a..ad7235b 100644 (file)
@@ -4,7 +4,7 @@
 static char sccsid[] = "@(#)fgetc.c    5.2 (Berkeley) 3/9/86";
 #endif
 
-#include <stdio.h>
+/*#include <stdio.h>*/
 
 int fgetc(fp) FILE *fp; {
        return(getc(fp));
index 542c92d..a43d2de 100644 (file)
@@ -4,7 +4,7 @@
 static char sccsid[] = "@(#)fgets.c    5.2 (Berkeley) 3/9/86";
 #endif
 
-#include       <stdio.h>
+/*#include     <stdio.h>*/
 
 char *fgets(s, n, iop) char *s; int n; register FILE *iop; {
        register c;
index d9f683c..d398dac 100644 (file)
@@ -13,9 +13,9 @@
 static char sccsid[] = "@(#)filbuf.c   5.3 (Berkeley) 3/9/86";
 #endif
 
-#include       <stdio.h>
-#include       <sys/types.h>
-#include       <sys/stat.h>
+/*#include     <stdio.h>*/
+/*#include     <sys/types.h>*/
+/*#include     <sys/stat.h>*/
 /*char *malloc();*/
 
 int _filbuf(iop) register FILE *iop; {
index c8c10cf..7fdcfba 100644 (file)
@@ -13,8 +13,8 @@
 static char sccsid[] = "@(#)findiop.c  5.6 (Berkeley) 3/9/86";
 #endif
 
-#include <stdio.h>
-#include <errno.h>
+/*#include <stdio.h>*/
+/*#include <errno.h>*/
 
 extern int errno;
 
@@ -93,7 +93,7 @@ int _f_morefiles() {
        return (1);
 }
 
-int f_prealloc() {
+void f_prealloc() {
        register FILE **iov;
        register FILE *fp;
 
@@ -105,7 +105,7 @@ int f_prealloc() {
                        *iov = (FILE *)calloc(1, sizeof **iov);
 }
 
-int _fwalk(function) register int (*function)(); {
+void _fwalk(function) register int (*function)(); {
        register FILE **iov;
        register FILE *fp;
 
@@ -120,7 +120,7 @@ int _fwalk(function) register int (*function)(); {
        }
 }
 
-int _cleanup() {
+void _cleanup() {
        extern int fclose();
 
        _fwalk(fclose);
index 940467a..4723b58 100644 (file)
@@ -14,9 +14,9 @@
 static char sccsid[] = "@(#)flsbuf.c   5.2 (Berkeley) 3/9/86";
 #endif
 
-#include       <stdio.h>
-#include       <sys/types.h>
-#include       <sys/stat.h>
+/*#include     <stdio.h>*/
+/*#include     <sys/types.h>*/
+/*#include     <sys/stat.h>*/
 
 /*char *malloc();*/
 
index 33c4314..dc3460d 100644 (file)
@@ -12,9 +12,9 @@
 static char sccsid[] = "@(#)fopen.c    5.2 (Berkeley) 3/9/86";
 #endif
 
-#include <sys/types.h>
-#include <sys/file.h>
-#include <stdio.h>
+/*#include <sys/types.h>*/
+/*#include <sys/file.h>*/
+/*#include <stdio.h>*/
 
 FILE *fopen(file, mode) char *file; register char *mode; {
        register FILE *iop;
index 3c9c84d..76f69fa 100644 (file)
@@ -1,10 +1,10 @@
 #include <stdio.h>
 #ifdef __STDC__
 #include <stdarg.h>
-#define _va_start(ap, arg) va_start(ap, arg)
+#define _va_start(argp, arg) va_start(argp, arg)
 #else
 #include <varargs.h>
-#define _va_start(ap, arg) va_start(ap)
+#define _va_start(argp, arg) va_start(argp)
 #endif
 
 /*
@@ -28,8 +28,8 @@
 static char sccsid[] = "@(#)fprintf.c  5.4 (Berkeley) 6/27/88";
 #endif
 
-#include <stdio.h>
-#include <varargs.h>
+/*#include <stdio.h>*/
+/*#include <varargs.h>*/
 
 #ifdef __STDC__
 int fprintf(register FILE *iop, char *fmt, ...)
@@ -37,23 +37,23 @@ int fprintf(register FILE *iop, char *fmt, ...)
 int fprintf(iop, fmt, va_alist) register FILE *iop; char *fmt; va_dcl
 #endif
 {
-       va_list ap;
+       va_list argp;
        int len;
        char localbuf[BUFSIZ];
 
-       _va_start(ap, fmt);
+       _va_start(argp, fmt);
        if (iop->_flag & _IONBF) {
                iop->_flag &= ~_IONBF;
                iop->_ptr = iop->_base = localbuf;
                iop->_bufsiz = BUFSIZ;
-               len = _doprnt(fmt, ap, iop);
+               len = _doprnt(fmt, argp, iop);
                fflush(iop);
                iop->_flag |= _IONBF;
                iop->_base = NULL;
                iop->_bufsiz = NULL;
                iop->_cnt = 0;
        } else
-               len = _doprnt(fmt, ap, iop);
-       va_end(ap);
+               len = _doprnt(fmt, argp, iop);
+       va_end(argp);
        return(ferror(iop) ? EOF : len);
 }
index 035533d..2106d52 100644 (file)
@@ -4,7 +4,7 @@
 static char sccsid[] = "@(#)fputc.c    5.2 (Berkeley) 3/9/86";
 #endif
 
-#include <stdio.h>
+/*#include <stdio.h>*/
 
 int fputc(c, fp) int c; register FILE *fp; {
        return(putc(c, fp));
index 9df1184..932dd05 100644 (file)
@@ -10,7 +10,7 @@
 static char sccsid[] = "@(#)fputs.c    5.2 (Berkeley) 3/9/86";
 #endif
 
-#include       <stdio.h>
+/*#include     <stdio.h>*/
 
 int fputs(s, iop) register char *s; register FILE *iop; {
        register r = 0;
index ed7c25f..32034dc 100644 (file)
@@ -11,7 +11,7 @@
 static char sccsid[] = "@(#)fread.c    5.2 (Berkeley) 3/9/86";
 #endif
 
-#include       <stdio.h>
+/*#include     <stdio.h>*/
 
 int fread(ptr, size, count, iop) register char *ptr; unsigned size; unsigned count; register FILE *iop; {
        register int s;
index 717dc9d..c73296d 100644 (file)
@@ -12,9 +12,9 @@
 static char sccsid[] = "@(#)freopen.c  5.2 (Berkeley) 3/9/86";
 #endif
 
-#include <sys/types.h>
-#include <sys/file.h>
-#include <stdio.h>
+/*#include <sys/types.h>*/
+/*#include <sys/file.h>*/
+/*#include <stdio.h>*/
 
 FILE *freopen(file, mode, iop) char *file; register char *mode; register FILE *iop; {
        register f, rw, oflags;
index c5e27cc..638142a 100644 (file)
@@ -9,7 +9,7 @@ static char sccsid[] = "@(#)fseek.c     5.3 (Berkeley) 3/9/86";
  * Seek for standard library.  Coordinates with buffering.
  */
 
-#include       <stdio.h>
+/*#include     <stdio.h>*/
 
 /*long lseek();*/
 
index 94e5ee5..6a94418 100644 (file)
@@ -10,7 +10,7 @@ static char sccsid[] = "@(#)ftell.c   5.2 (Berkeley) 3/9/86";
  * Coordinates with buffering.
  */
 
-#include       <stdio.h>
+/*#include     <stdio.h>*/
 /*long lseek();*/
 
 long ftell(iop) register FILE *iop; {
index ec53e37..4afd737 100644 (file)
@@ -11,7 +11,7 @@
 static char sccsid[] = "@(#)fwrite.c   5.2 (Berkeley) 3/9/86";
 #endif
 
-#include       <stdio.h>
+/*#include     <stdio.h>*/
 
 int fwrite(ptr, size, count, iop) register char *ptr; unsigned size; unsigned count; register FILE *iop; {
        register int s;
index 5cf7f71..53fa8b0 100644 (file)
@@ -7,7 +7,7 @@ static char sccsid[] = "@(#)getchar.c   5.2 (Berkeley) 3/9/86";
 /*
  * A subroutine version of the macro getchar.
  */
-#include <stdio.h>
+/*#include <stdio.h>*/
 
 #undef getchar
 
index bdfbc9b..73e5ecb 100644 (file)
@@ -4,7 +4,7 @@
 static char sccsid[] = "@(#)gets.c     5.2 (Berkeley) 3/9/86";
 #endif
 
-#include       <stdio.h>
+/*#include     <stdio.h>*/
 
 char *gets(s) char *s; {
        register c;
index fcfe6e8..187e43d 100644 (file)
@@ -4,7 +4,7 @@
 static char sccsid[] = "@(#)getw.c     5.2 (Berkeley) 3/9/86";
 #endif
 
-#include <stdio.h>
+/*#include <stdio.h>*/
 
 int getw(iop) register FILE *iop; {
        register i;
index d0c1479..a9c8c5e 100644 (file)
@@ -16,8 +16,8 @@
 static char sccsid[] = "@(#)popen.c    5.4 (Berkeley) 3/26/86";
 #endif
 
-#include <stdio.h>
-#include <signal.h>
+/*#include <stdio.h>*/
+/*#include <signal.h>*/
 
 #define        tst(a,b)        (*mode == 'r'? (b) : (a))
 #define        RDR     0
index c173835..f2fdfd1 100644 (file)
@@ -1,10 +1,10 @@
 #include <stdio.h>
 #ifdef __STDC__
 #include <stdarg.h>
-#define _va_start(ap, arg) va_start(ap, arg)
+#define _va_start(argp, arg) va_start(argp, arg)
 #else
 #include <varargs.h>
-#define _va_start(ap, arg) va_start(ap)
+#define _va_start(argp, arg) va_start(argp)
 #endif
 
 /*
@@ -28,8 +28,8 @@
 static char sccsid[] = "@(#)printf.c   5.4 (Berkeley) 6/27/88";
 #endif
 
-#include <stdio.h>
-#include <varargs.h>
+/*#include <stdio.h>*/
+/*#include <varargs.h>*/
 
 #ifdef __STDC__
 int printf(char *fmt, ...)
@@ -37,11 +37,11 @@ int printf(char *fmt, ...)
 int printf(fmt, va_alist) char *fmt; va_dcl
 #endif
 {
-       va_list ap;
+       va_list argp;
        int len;
 
-       _va_start(ap, fmt);
-       len = _doprnt(fmt, ap, stdout);
-       va_end(ap);
+       _va_start(argp, fmt);
+       len = _doprnt(fmt, argp, stdout);
+       va_end(argp);
        return(ferror(stdout) ? EOF : len);
 }
index 7c65b4a..9a63dc1 100644 (file)
@@ -7,7 +7,7 @@ static char sccsid[] = "@(#)putchar.c   5.2 (Berkeley) 3/9/86";
 /*
  * A subroutine version of the macro putchar
  */
-#include <stdio.h>
+/*#include <stdio.h>*/
 
 #undef putchar
 
index 9664963..a0e1669 100644 (file)
@@ -4,7 +4,7 @@
 static char sccsid[] = "@(#)puts.c     5.2 (Berkeley) 3/9/86";
 #endif
 
-#include       <stdio.h>
+/*#include     <stdio.h>*/
 
 int puts(s) register char *s; {
        register c;
index 839fdef..d307535 100644 (file)
@@ -4,7 +4,7 @@
 static char sccsid[] = "@(#)putw.c     5.2 (Berkeley) 3/9/86";
 #endif
 
-#include <stdio.h>
+/*#include <stdio.h>*/
 
 int putw(w, iop) int w; register FILE *iop; {
        register char *p;
index 2f54eaf..6ced2c1 100644 (file)
@@ -5,7 +5,7 @@
 static char sccsid[] = "@(#)rew.c      5.2 (Berkeley) 3/9/86";
 #endif
 
-#include       <stdio.h>
+/*#include     <stdio.h>*/
 
 int rewind(iop) register FILE *iop; {
        fflush(iop);
index 0f060cf..d43cdf7 100644 (file)
@@ -1,18 +1,18 @@
 #include <stdio.h>
 #ifdef __STDC__
 #include <stdarg.h>
-#define _va_start(ap, arg) va_start(ap, arg)
+#define _va_start(argp, arg) va_start(argp, arg)
 #else
 #include <varargs.h>
-#define _va_start(ap, arg) va_start(ap)
+#define _va_start(argp, arg) va_start(argp)
 #endif
 
 #if defined(LIBC_SCCS) && !defined(lint)
 static char sccsid[] = "@(#)scanf.c    5.2 (Berkeley) 3/9/86";
 #endif
 
-#include <stdio.h>
-#include <varargs.h>
+/*#include <stdio.h>*/
+/*#include <varargs.h>*/
 
 #ifdef __STDC__
 int scanf(char *fmt, ...)
@@ -20,12 +20,12 @@ int scanf(char *fmt, ...)
 int scanf(fmt, va_alist) char *fmt; va_dcl
 #endif
 {
-       va_list ap;
+       va_list argp;
        int len;
 
-       _va_start(ap, fmt);
-       len = _doscan(stdin, fmt, &args);
-       va_end(ap);
+       _va_start(argp, fmt);
+       len = _doscan(stdin, fmt, argp);
+       va_end(argp);
        return len;
 }
 
@@ -35,12 +35,12 @@ int fscanf(FILE *iop, char *fmt, ...)
 int fscanf(iop, fmt, va_alist) FILE *iop; char *fmt; va_dcl
 #endif
 {
-       va_list ap;
+       va_list argp;
        int len;
 
-       _va_start(ap, fmt);
-       len = _doscan(iop, fmt, &args);
-       va_end(ap);
+       _va_start(argp, fmt);
+       len = _doscan(iop, fmt, argp);
+       va_end(argp);
        return len;
 }
 
@@ -51,17 +51,17 @@ int sscanf(str, fmt, va_alist) register char *str; char *fmt; va_dcl
 #endif
 {
        FILE _strbuf;
-       va_list ap;
+       va_list argp;
        int len;
 
-       _va_start(ap, fmt);
+       _va_start(argp, fmt);
        _strbuf._flag = _IOREAD|_IOSTRG;
        _strbuf._ptr = _strbuf._base = str;
        _strbuf._cnt = 0;
        while (*str++)
                _strbuf._cnt++;
        _strbuf._bufsiz = _strbuf._cnt;
-       len = _doscan(&_strbuf, fmt, &args);
-       va_end(ap);
+       len = _doscan(&_strbuf, fmt, argp);
+       va_end(argp);
        return len;
 }
index 1b895bb..c51b025 100644 (file)
@@ -11,7 +11,7 @@
 static char sccsid[] = "@(#)setbuf.c   5.2 (Berkeley) 3/9/86";
 #endif
 
-#include       <stdio.h>
+/*#include     <stdio.h>*/
 
 int setbuf(iop, buf) register FILE *iop; char *buf; {
        if (iop->_base != NULL && iop->_flag&_IOMYBUF)
index f759878..4cb3cd0 100644 (file)
@@ -11,7 +11,7 @@
 static char sccsid[] = "@(#)setbuffer.c        5.2 (Berkeley) 3/9/86";
 #endif
 
-#include       <stdio.h>
+/*#include     <stdio.h>*/
 
 int setbuffer(iop, buf, size) register FILE *iop; char *buf; int size; {
        if (iop->_base != NULL && iop->_flag&_IOMYBUF)
index 6b93835..b749e84 100644 (file)
@@ -4,6 +4,6 @@
 static char sccsid[] = "@(#)sibuf.c    5.2 (Berkeley) 3/9/86";
 #endif
 
-#include <stdio.h>
+/*#include <stdio.h>*/
 
 char   _sibuf[BUFSIZ];
index db58746..dee91d1 100644 (file)
@@ -4,6 +4,6 @@
 static char sccsid[] = "@(#)sobuf.c    5.2 (Berkeley) 3/9/86";
 #endif
 
-#include <stdio.h>
+/*#include <stdio.h>*/
 
 char   _sobuf[BUFSIZ];
index 029bebd..7403f05 100644 (file)
@@ -1,10 +1,10 @@
 #include <stdio.h>
 #ifdef __STDC__
 #include <stdarg.h>
-#define _va_start(ap, arg) va_start(ap, arg)
+#define _va_start(argp, arg) va_start(argp, arg)
 #else
 #include <varargs.h>
-#define _va_start(ap, arg) va_start(ap)
+#define _va_start(argp, arg) va_start(argp)
 #endif
 
 /*
@@ -28,8 +28,8 @@
 static char sccsid[] = "@(#)sprintf.c  5.5 (Berkeley) 6/27/88";
 #endif
 
-#include <stdio.h>
-#include <varargs.h>
+/*#include <stdio.h>*/
+/*#include <varargs.h>*/
 
 #ifdef __STDC__
 int sprintf(char *str, char *fmt, ...)
@@ -37,16 +37,16 @@ int sprintf(char *str, char *fmt, ...)
 int sprintf(str, fmt, va_alist) char *str; char *fmt; va_dcl
 #endif
 {
-       va_list ap;
+       va_list argp;
        FILE _strbuf;
        int len;
 
-       _va_start(ap, fmt);
+       _va_start(argp, fmt);
        _strbuf._flag = _IOWRT+_IOSTRG;
        _strbuf._ptr = str;
        _strbuf._cnt = 32767;
-       len = _doprnt(fmt, ap, &_strbuf);
+       len = _doprnt(fmt, argp, &_strbuf);
        *_strbuf._ptr = 0;
-       va_end(ap);
+       va_end(argp);
        return(len);
 }
index c7579b7..520cb33 100644 (file)
@@ -4,7 +4,7 @@
 static char sccsid[] = "@(#)strout.c   5.2 (Berkeley) 3/9/86";
 #endif
 
-#include       <stdio.h>
+/*#include     <stdio.h>*/
 
 int _strout(count, string, adjust, file, fillch) register count; register char *string; int adjust; register FILE *file; int fillch; {
        while (adjust < 0) {
index f021a4f..c041c3d 100644 (file)
@@ -4,7 +4,7 @@
 static char sccsid[] = "@(#)ungetc.c   5.3 (Berkeley) 3/26/86";
 #endif
 
-#include <stdio.h>
+/*#include <stdio.h>*/
 
 int ungetc(c, iop) int c; register FILE *iop; {
        if (c == EOF || (iop->_flag & (_IOREAD|_IORW)) == 0 ||
index 79adc6a..300a166 100644 (file)
@@ -1,10 +1,10 @@
 #include <stdio.h>
 #ifdef __STDC__
 #include <stdarg.h>
-#define _va_start(ap, arg) va_start(ap, arg)
+#define _va_start(argp, arg) va_start(argp, arg)
 #else
 #include <varargs.h>
-#define _va_start(ap, arg) va_start(ap)
+#define _va_start(argp, arg) va_start(argp)
 #endif
 
 /*
 static char sccsid[] = "@(#)vfprintf.c 5.2 (Berkeley) 6/27/88";
 #endif
 
-#include <stdio.h>
-#include <varargs.h>
+/*#include <stdio.h>*/
+/*#include <varargs.h>*/
 
-int vfprintf(iop, fmt, ap) FILE *iop; char *fmt; va_list ap; {
+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, ap, iop);
+               len = _doprnt(fmt, argp, iop);
                (void) fflush(iop);
                iop->_flag |= _IONBF;
                iop->_base = NULL;
                iop->_bufsiz = 0;
                iop->_cnt = 0;
        } else
-               len = _doprnt(fmt, ap, iop);
+               len = _doprnt(fmt, argp, iop);
 
        return (ferror(iop) ? EOF : len);
 }
index eb1a154..2c72c95 100644 (file)
@@ -1,10 +1,10 @@
 #include <stdio.h>
 #ifdef __STDC__
 #include <stdarg.h>
-#define _va_start(ap, arg) va_start(ap, arg)
+#define _va_start(argp, arg) va_start(argp, arg)
 #else
 #include <varargs.h>
-#define _va_start(ap, arg) va_start(ap)
+#define _va_start(argp, arg) va_start(argp)
 #endif
 
 /*
 static char sccsid[] = "@(#)vprintf.c  5.2 (Berkeley) 6/27/88";
 #endif
 
-#include <stdio.h>
-#include <varargs.h>
+/*#include <stdio.h>*/
+/*#include <varargs.h>*/
 
-int vprintf(fmt, ap) char *fmt; va_list ap; {
+int vprintf(fmt, argp) char *fmt; va_list argp; {
        int len;
 
-       len = _doprnt(fmt, ap, stdout);
+       len = _doprnt(fmt, argp, stdout);
        return (ferror(stdout) ? EOF : len);
 }
index c42ab59..1b8f648 100644 (file)
@@ -1,10 +1,10 @@
 #include <stdio.h>
 #ifdef __STDC__
 #include <stdarg.h>
-#define _va_start(ap, arg) va_start(ap, arg)
+#define _va_start(argp, arg) va_start(argp, arg)
 #else
 #include <varargs.h>
-#define _va_start(ap, arg) va_start(ap)
+#define _va_start(argp, arg) va_start(argp)
 #endif
 
 /*
 static char sccsid[] = "@(#)vsprintf.c 5.2 (Berkeley) 6/27/88";
 #endif
 
-#include <stdio.h>
-#include <varargs.h>
+/*#include <stdio.h>*/
+/*#include <varargs.h>*/
 
-int vsprintf(str, fmt, ap) char *str; char *fmt; va_list ap; {
+int vsprintf(str, fmt, argp) char *str; char *fmt; va_list argp; {
        FILE f;
        int len;
 
        f._flag = _IOWRT+_IOSTRG;
        f._ptr = str;
        f._cnt = 32767;
-       len = _doprnt(fmt, ap, &f);
+       len = _doprnt(fmt, argp, &f);
        *f._ptr = 0;
        return (len);
 }
index 65a3832..23fb9ef 100644 (file)
@@ -1,8 +1,8 @@
 #ifndef _SYS_IOCTL_H_
 #define _SYS_IOCTL_H_
 
-#include <net/if_arp.h>
 #include <net/if.h>
+#include <net/if_arp.h>
 #include <net/route.h>
 #include <sys/types.h>
 
@@ -294,11 +294,11 @@ int gtty __P((int fd, struct sgttyb *ap));
 /* compat-4.1/stty.c */
 int stty __P((int fd, struct sgttyb *ap));
 
-/* gen/isatty.c */
-int isatty __P((int f));
-
 /* sys/ioctl.c */
 int ioctl __P((int d, u_long r, char *p));
+
+/* sys/isatty.c */
+int isatty __P((int f));
 #endif
 
 #endif
similarity index 92%
rename from lib/libstdc/gen/isatty.c
rename to lib/libstdc/sys/isatty.c
index cd41d93..77fdcdb 100644 (file)
@@ -8,7 +8,7 @@ static char sccsid[] = "@(#)isatty.c    5.2 (Berkeley) 3/9/86";
  * Returns 1 iff file is a tty
  */
 
-#include <sgtty.h>
+/*#include <sgtty.h>*/
 
 int isatty(f) int f; {
        struct sgttyb ttyb;
index 21cc439..1557267 100644 (file)
@@ -19,7 +19,7 @@
 #ifdef KERNEL
 #include "uio.h"
 #else
-#include <sys/uio.h>
+/*#include <sys/uio.h>*/
 #endif
 
 /*
index 22490ac..cb0b8ff 100644 (file)
 #define        CROUND  (CBLOCK - 1)                            /* clist rounding */
 
 #ifndef KERNEL
-#include       <sys/types.h>
+/*#include     <sys/types.h>*/
 #else
 #ifndef LOCORE
 #include       "types.h"
index 1d9809f..87b2d7c 100644 (file)
@@ -209,6 +209,9 @@ int setregid __P((int r, int e));
 
 /* sys/setreuid.c */
 int setreuid __P((int r, int e));
+
+/* sys/vfork.c */
+int vfork __P((void));
 #endif
 
 #endif
index 964f2f3..6454a3d 100644 (file)
@@ -76,9 +76,9 @@
 #endif
 
 /* gen/syslog.c */
-int syslog __P((int pri, char *fmt, int p0, int p1, int p2, int p3, int p4));
-int openlog __P((char *ident, int logstat, int logfac));
-int closelog __P((void));
+void syslog __P((int pri, char *fmt, int p0, int p1, int p2, int p3, int p4));
+void openlog __P((char *ident, int logstat, int logfac));
+void closelog __P((void));
 int setlogmask __P((int pmask));
 #endif
 
index b333556..9ba4fd0 100644 (file)
@@ -18,7 +18,7 @@
 #ifdef KERNEL
 #include "../h/ioctl.h"
 #else
-#include <sys/ioctl.h>
+/*#include <sys/ioctl.h>*/
 #endif
 
 /*
index 818af8f..284fd44 100644 (file)
@@ -76,7 +76,7 @@ int utime __P((char *name, int otv[]));
 int alarm __P((int secs));
 
 /* gen/sleep.c */
-int sleep __P((unsigned n));
+void sleep __P((unsigned n));
 
 /* gen/time.c */
 long time __P((time_t *t));
@@ -85,7 +85,7 @@ long time __P((time_t *t));
 unsigned ualarm __P((register unsigned usecs, register unsigned reload));
 
 /* gen/usleep.c */
-int usleep __P((unsigned n));
+void usleep __P((unsigned n));
 
 /* sys/adjtime.c */
 int adjtime __P((struct timeval *delta, struct timeval *odelta));
index 94c95a0..ae17cc1 100644 (file)
@@ -17,7 +17,7 @@
 #include "ttychars.h"
 #include "ttydev.h"
 #else
-#include <sys/ttychars.h>
+/*#include <sys/ttychars.h>*/
 #include <sys/ttydev.h>
 #endif
 
index 1de262d..f467b13 100644 (file)
 #include "namei.h"
 #else
 #include <machine/pcb.h>
-#include <sys/dmap.h>
-#include <sys/time.h>
-#include <sys/resource.h>
-#include <sys/namei.h>
+/*#include <sys/dmap.h>*/
+/*#include <sys/time.h>*/
+/*#include <sys/resource.h>*/
+/*#include <sys/namei.h>*/
 #endif
 
 /*
index ede48f9..7e8391b 100644 (file)
@@ -15,7 +15,7 @@
 #ifdef KERNEL
 #include "ioctl.h"
 #else
-#include <sys/ioctl.h>
+/*#include <sys/ioctl.h>*/
 #endif
 #endif
 
diff --git a/lib/libstdc/sys/vfork.c b/lib/libstdc/sys/vfork.c
new file mode 100644 (file)
index 0000000..f1b60ad
--- /dev/null
@@ -0,0 +1,6 @@
+#include <gen.h>
+#include <sys/proc.h>
+
+int vfork() {
+  abort();
+}
index 96d5ecb..3943dc8 100644 (file)
@@ -1,3 +1,6 @@
+csu/crt0.c
+csu/gmon.c
+csu/mon.c
 vax/compat-4.1/reset.s
 vax/sys/Ovfork.s
 vax/sys/syscall.s
@@ -8,3 +11,4 @@ vax/gen/fabs.s
 vax/gen/urem.s
 vax/gen/alloca.s
 vax/gen/nargs.s
+mp.h
index 4f65e44..3eeb202 100644 (file)
@@ -14,7 +14,7 @@
 #ifdef KERNEL
 #include "ioctl.h"
 #else
-#include <sys/ioctl.h>
+/*#include <sys/ioctl.h>*/
 #endif
 
 /*
index 9495d26..d2d937e 100644 (file)
@@ -3,8 +3,8 @@
 #ifndef x__NETINET_IF_ETHER_H_
 #define x__NETINET_IF_ETHER_H_
 
-#include <net/x_if_arp.h>
 #include <net/x_if.h>
+#include <net/x_if_arp.h>
 #include <netinet/x_in.h>
 #include <sys/x_types.h>
 
index eaca804..d14b02f 100644 (file)
@@ -3,8 +3,8 @@
 #ifndef x__NETINET_IN_PCB_H_
 #define x__NETINET_IN_PCB_H_
 
-#include <netinet/x_in.h>
 #include <net/x_route.h>
+#include <netinet/x_in.h>
 #include <sys/x_types.h>
 
 /*
index c96a7ec..cb6f564 100644 (file)
@@ -4,8 +4,8 @@
 #define x__NETINET_TCP_DEBUG_H_
 
 #include <netinet/x_in_systm.h>
-#include <netinet/x_tcpip.h>
 #include <netinet/x_tcp_var.h>
+#include <netinet/x_tcpip.h>
 #include <sys/x_types.h>
 
 /*
index 0bf0d22..a03f5cf 100644 (file)
@@ -3,8 +3,8 @@
 #ifndef x__NETNS_NS_PCB_H_
 #define x__NETNS_NS_PCB_H_
 
-#include <netns/x_ns.h>
 #include <net/x_route.h>
+#include <netns/x_ns.h>
 #include <sys/x_types.h>
 
 /*
index 0716c28..2102c56 100644 (file)
@@ -3,8 +3,8 @@
 #ifndef x__SYS_IOCTL_H_
 #define x__SYS_IOCTL_H_
 
-#include <net/x_if_arp.h>
 #include <net/x_if.h>
+#include <net/x_if_arp.h>
 #include <net/x_route.h>
 #include <sys/x_types.h>
 
@@ -296,11 +296,11 @@ x_int x_gtty __P((x_int x_fd, struct x_sgttyb *x_ap));
 /* compat-4.1/stty.c */
 x_int x_stty __P((x_int x_fd, struct x_sgttyb *x_ap));
 
-/* gen/isatty.c */
-x_int x_isatty __P((x_int x_f));
-
 /* sys/ioctl.c */
 x_int x_ioctl __P((x_int x_d, x_u_long x_r, char *x_p));
+
+/* sys/isatty.c */
+x_int x_isatty __P((x_int x_f));
 #endif
 
 #endif
index 73b7368..c9d21eb 100644 (file)
@@ -41,7 +41,7 @@ double        x_avenrun[3];
 #ifdef x_GPROF
 extern x_int x_profiling;
 extern char *x_s_lowpc;
-extern x_u_long x_s_textsize;
+extern x_int   x_u_long x_s_textsize;
 extern x_u_short *x_kcount;
 #endif
 
index e70d454..bfd9dfd 100644 (file)
@@ -21,7 +21,7 @@
 #ifdef x_KERNEL
 #include "x_uio.h"
 #else
-#include <sys/x_uio.h>
+/*#include <sys/uio.h>*/
 #endif
 
 /*
index 08b5774..4500e1a 100644 (file)
 #define        x_CROUND        (x_CBLOCK - 1)                          /* clist rounding */
 
 #ifndef x_KERNEL
-#include       <sys/x_types.h>
+/*#include     <sys/types.h>*/
 #else
 #ifndef x_LOCORE
 #include       "x_types.h"
index f2d2611..923b4ba 100644 (file)
@@ -211,6 +211,9 @@ x_int x_setregid __P((x_int x_r, x_int x_e));
 
 /* sys/setreuid.c */
 x_int x_setreuid __P((x_int x_r, x_int x_e));
+
+/* sys/vfork.c */
+x_int x_vfork __P((void));
 #endif
 
 #endif
index 7d5e271..f0089a7 100644 (file)
@@ -78,9 +78,9 @@
 #endif
 
 /* gen/syslog.c */
-x_int x_syslog __P((x_int x_pri, char *x_fmt, x_int x_p0, x_int x_p1, x_int x_p2, x_int x_p3, x_int x_p4));
-x_int x_openlog __P((char *x_ident, x_int x_logstat, x_int x_logfac));
-x_int x_closelog __P((void));
+void x_syslog __P((x_int x_pri, char *x_fmt, x_int x_p0, x_int x_p1, x_int x_p2, x_int x_p3, x_int x_p4));
+void x_openlog __P((char *x_ident, x_int x_logstat, x_int x_logfac));
+void x_closelog __P((void));
 x_int x_setlogmask __P((x_int x_pmask));
 #endif
 
index a56c83d..9dd9e33 100644 (file)
@@ -20,7 +20,7 @@
 #ifdef x_KERNEL
 #include "../h/x_ioctl.h"
 #else
-#include <sys/x_ioctl.h>
+/*#include <sys/ioctl.h>*/
 #endif
 
 /*
index f34975b..7399645 100644 (file)
@@ -78,7 +78,7 @@ x_int x_utime __P((char *x_name, x_int x_otv[]));
 x_int x_alarm __P((x_int x_secs));
 
 /* gen/sleep.c */
-x_int x_sleep __P((x_unsigned_int x_n));
+void x_sleep __P((x_unsigned_int x_n));
 
 /* gen/time.c */
 x_long x_time __P((x_time_t *x_t));
@@ -87,7 +87,7 @@ x_long x_time __P((x_time_t *x_t));
 x_unsigned_int x_ualarm __P((register x_unsigned_int x_usecs, register x_unsigned_int x_reload));
 
 /* gen/usleep.c */
-x_int x_usleep __P((x_unsigned_int x_n));
+void x_usleep __P((x_unsigned_int x_n));
 
 /* sys/adjtime.c */
 x_int x_adjtime __P((struct x_timeval *x_delta, struct x_timeval *x_odelta));
index 48037d9..7f4921e 100644 (file)
@@ -19,7 +19,7 @@
 #include "x_ttychars.h"
 #include "x_ttydev.h"
 #else
-#include <sys/x_ttychars.h>
+/*#include <sys/ttychars.h>*/
 #include <sys/x_ttydev.h>
 #endif
 
index a4f1b5c..46990ca 100644 (file)
 #include "x_namei.h"
 #else
 #include <machine/x_pcb.h>
-#include <sys/x_dmap.h>
-#include <sys/x_time.h>
-#include <sys/x_resource.h>
-#include <sys/x_namei.h>
+/*#include <sys/dmap.h>*/
+/*#include <sys/time.h>*/
+/*#include <sys/resource.h>*/
+/*#include <sys/namei.h>*/
 #endif
 
 /*
index 9defad5..19ce51a 100644 (file)
@@ -17,7 +17,7 @@
 #ifdef x_KERNEL
 #include "x_ioctl.h"
 #else
-#include <sys/x_ioctl.h>
+/*#include <sys/ioctl.h>*/
 #endif
 #endif
 
index f7e113b..843b84a 100644 (file)
@@ -16,7 +16,7 @@
 #ifdef x_KERNEL
 #include "x_ioctl.h"
 #else
-#include <sys/x_ioctl.h>
+/*#include <sys/ioctl.h>*/
 #endif
 
 /*
index b3e7c20..1d112a3 100644 (file)
@@ -1,7 +1,18 @@
+#ifndef X_
 #define X_
+
+#define _va_arg_short(argp) va_arg(argp, int)
+#define _va_arg_int(argp) va_arg(argp, int)
+#define _va_arg_long(argp) va_arg(argp, int)
+#define _va_arg_unsigned_short(argp) va_arg(argp, unsigned int)
+#define _va_arg_unsigned_int(argp) va_arg(argp, unsigned int)
+#define _va_arg_unsigned_long(argp) va_arg(argp, unsigned int)
+
 typedef short x_short;
 typedef int x_int;
 typedef int x_long;
 typedef unsigned short x_unsigned_short;
 typedef unsigned int x_unsigned_int;
 typedef unsigned int x_unsigned_long;
+
+#endif
index 7f57832..331e8e0 100644 (file)
@@ -3,7 +3,6 @@
 #ifndef x__ASSERT_H_
 #define x__ASSERT_H_
 
-#include <x_csu.h>
 #include <x_stdio.h>
 
 /*     assert.h        4.2     85/01/21        */
index 571f379..8ceba70 100644 (file)
@@ -5,8 +5,8 @@
 
 #include <sys/x_ioctl.h>
 #include <sys/x_resource.h>
-#include <sys/x_timeb.h>
 #include <sys/x_time.h>
+#include <sys/x_timeb.h>
 #include <sys/x_times.h>
 #include <sys/x_vlimit.h>
 #include <sys/x_vtimes.h>
diff --git a/x_include/x_csu.h b/x_include/x_csu.h
deleted file mode 100644 (file)
index b2bb791..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-#include "x_.h"
-
-#ifndef x__CSU_H_
-#define x__CSU_H_
-
-#ifndef x_KERNEL
-#ifndef __P
-#ifdef __STDC__
-#define __P(x_args) x_args
-#else
-#define __P(x_args) ()
-#endif
-#endif
-
-/* csu/crt0.c */
-x_int x_start __P((void));
-x_int x_exit __P((register x_int x_code));
-x_int x_moncontrol __P((x_int x_val));
-
-/* csu/gmon.c */
-x_int x_monstartup __P((char *x_lowpc, char *x_highpc));
-x_int x__mcleanup __P((void));
-x_int x_mcount __P((void));
-x_int x_monitor __P((char *x_lowpc, char *x_highpc, char *x_buf, x_int x_bufsiz, x_int x_nfunc));
-x_int x_moncontrol __P((x_int x_mode));
-
-/* csu/mon.c */
-x_int x_monstartup __P((char *x_lowpc, char *x_highpc));
-x_int x_mcount __P((void));
-x_int x_monitor __P((char *x_lowpc, char *x_highpc, char *x_buf, x_int x_bufsiz, x_int x_cntsiz));
-x_int x_moncontrol __P((x_int x_mode));
-#endif
-
-#endif
index f1876ca..a970980 100644 (file)
@@ -16,7 +16,6 @@
 #include <sys/x_dir.h>
 #include <sys/x_errno.h>
 #include <sys/x_exec.h>
-#include <sys/x_ioctl.h>
 #include <sys/x_proc.h>
 #include <sys/x_signal.h>
 #include <sys/x_syslog.h>
@@ -75,7 +74,7 @@ char *x_ecvt __P((double x_arg, x_int x_ndigits, x_int *x_decpt, x_int *x_sign))
 char *x_fcvt __P((double x_arg, x_int x_ndigits, x_int *x_decpt, x_int *x_sign));
 
 /* gen/fakcu.c */
-x_int x__cleanup __P((void));
+void x__cleanup __P((void));
 
 /* gen/ffs.c */
 x_int x_ffs __P((register x_long x_mask));
@@ -99,10 +98,10 @@ x_int x_insque __P((register struct x_vaxque *x_e, register struct x_vaxque *x_p
 
 /* gen/malloc.c */
 char *x_malloc __P((x_unsigned_int x_nbytes));
-x_int x_morecore __P((x_int x_bucket));
-x_int x_free __P((char *x_cp));
+void x_morecore __P((x_int x_bucket));
+void x_free __P((char *x_cp));
 char *x_realloc __P((char *x_cp, x_unsigned_int x_nbytes));
-x_int x_mstats __P((char *x_s));
+void x_mstats __P((char *x_s));
 
 /* gen/mkstemp.c */
 x_int x_mkstemp __P((char *x_as));
@@ -111,7 +110,7 @@ x_int x_mkstemp __P((char *x_as));
 char *x_mktemp __P((char *x_as));
 
 /* gen/qsort.c */
-x_int x_qsort __P((char *x_base, x_int x_n, x_int x_size, x_int (*x_compar)(void)));
+void x_qsort __P((char *x_base, x_int x_n, x_int x_size, x_int (*x_compar)(void)));
 
 /* gen/random.c */
 x_int x_srandom __P((x_unsigned_int x_x));
diff --git a/x_include/x_mp.h b/x_include/x_mp.h
deleted file mode 100644 (file)
index 555ecd3..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-#include "x_.h"
-
-#ifndef x__MP_H_
-#define x__MP_H_
-
-#include <x_gen.h>
-#include <x_stdio.h>
-
-/*
- * 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 x_MINT struct x_mint
-x_MINT
-{      x_int x_len;
-       x_short *x_val;
-};
-#define x_FREE(x_x) {if(x_x.x_len!=0) {x_free((char *)x_x.x_val); x_x.x_len=0;}}
-#ifndef x_DBG
-#define x_shfree(x_u) x_free((char *)x_u)
-#else
-#include <x_stdio.h>
-#define x_shfree(x_u) { if(x_dbg) x_fprintf(x_stderr, "free %o\n", x_u); x_free((char *)x_u);}
-extern x_int x_dbg;
-#endif
-#ifndef x_vax
-struct x_half
-{      x_short x_high;
-       x_short x_low;
-};
-#else
-struct x_half
-{      x_short x_low;
-       x_short x_high;
-};
-#endif
-/*extern MINT *itom();*/
-/*extern short *xalloc();*/
-
-#ifdef x_lint
-extern x_xv_oid;
-#define x_VOID x_xv_oid =
-#else
-#define x_VOID
-#endif
-
-#endif
index 780e04a..1e04e0f 100644 (file)
@@ -6,22 +6,24 @@
 #include <arpa/x_nameser.h>
 #include <x_netdb.h>
 #include <x_stdio.h>
+#include <sys/x_types.h>
 
 /* formerly duplicated in netinet/in.h and netns/ns.h */
-#if !defined(x_vax) && !defined(x_ntohl) && !defined(x_lint)
+/* confuses cproto which thinks #define names are types or type modifiers */
+/*#if !defined(vax) && !defined(ntohl) && !defined(lint)*/
 /*
  * Macros for number representation conversion.
  */
-#define        x_ntohl(x_x)    (x_x)
-#define        x_ntohs(x_x)    (x_x)
-#define        x_htonl(x_x)    (x_x)
-#define        x_htons(x_x)    (x_x)
-#endif
+/*#define      ntohl(x)        (x)*/
+/*#define      ntohs(x)        (x)*/
+/*#define      htonl(x)        (x)*/
+/*#define      htons(x)        (x)*/
+/*#endif*/
 
-#if !defined(x_ntohl) && (defined(x_vax) || defined(x_lint))
+/*#if !defined(ntohl) && (defined(vax) || defined(lint))*/
 /*u_short      ntohs(), htons();*/
 /*u_long       ntohl(), htonl();*/
-#endif
+/*#endif*/
 
 #ifndef x_KERNEL
 #ifndef __P
 #endif
 #endif
 
+/* net/htonl.c */
+x_u_long x_htonl __P((x_u_long x_hostlong));
+
+/* net/htons.c */
+x_u_short x_htons __P((x_int x_hostshort));
+
+/* net/ntohl.c */
+x_u_long x_ntohl __P((x_u_long x_netlong));
+
+/* net/ntohs.c */
+x_u_short x_ntohs __P((x_int x_netshort));
+
 /* net/rcmd.c */
 x_int x_rcmd __P((char **x_ahost, x_int x_rport, char *x_locuser, char *x_remuser, char *x_cmd, x_int *x_fd2p));
 x_int x_rresvport __P((x_int *x_alport));
@@ -43,9 +57,9 @@ x_int x__checkhost __P((char *x_rhost, char *x_lhost, x_int x_len));
 x_int x_rexec __P((char **x_ahost, x_int x_rport, char *x_name, char *x_pass, char *x_cmd, x_int *x_fd2p));
 
 /* net/ruserpass.c */
-x_int x_ruserpass __P((char *x_host, char **x_aname, char **x_apass));
-x_int x_mkpwunclear __P((char *x_spasswd, x_int x_mch, char *x_sencpasswd));
-x_int x_mkpwclear __P((char *x_sencpasswd, x_int x_mch, char *x_spasswd));
+void x_ruserpass __P((char *x_host, char **x_aname, char **x_apass));
+void x_mkpwunclear __P((char *x_spasswd, x_int x_mch, char *x_sencpasswd));
+void x_mkpwclear __P((char *x_sencpasswd, x_int x_mch, char *x_spasswd));
 #endif
 
 #endif
index 648c733..3686f5d 100644 (file)
@@ -90,7 +90,7 @@ x_int x_clearerr __P((register x_FILE *x_iop));
 x_int x__doprnt __P((x_u_char *x_fmt0, va_list x_argp, register x_FILE *x_fp));
 
 /* stdio/doscan.c */
-x_int x__doscan __P((x_FILE *x_iop, register char *x_fmt, register va_list x_ap));
+x_int x__doscan __P((x_FILE *x_iop, register char *x_fmt, register va_list x_argp));
 
 /* stdio/exit.c */
 x_int x_exit __P((x_int x_code));
@@ -110,9 +110,9 @@ x_int x__filbuf __P((register x_FILE *x_iop));
 /* stdio/findiop.c */
 x_FILE *x__findiop __P((void));
 x_int x__f_morefiles __P((void));
-x_int x_f_prealloc __P((void));
-x_int x__fwalk __P((register x_int (*x_function)(void)));
-x_int x__cleanup __P((void));
+void x_f_prealloc __P((void));
+void x__fwalk __P((register x_int (*x_function)(void)));
+void x__cleanup __P((void));
 
 /* stdio/flsbuf.c */
 x_int x__flsbuf __P((x_int x_c, register x_FILE *x_iop));
@@ -196,13 +196,13 @@ x_int x__strout __P((register x_int x_count, register char *x_string, x_int x_ad
 x_int x_ungetc __P((x_int x_c, register x_FILE *x_iop));
 
 /* stdio/vfprintf.c */
-x_int x_vfprintf __P((x_FILE *x_iop, char *x_fmt, va_list x_ap));
+x_int x_vfprintf __P((x_FILE *x_iop, char *x_fmt, va_list x_argp));
 
 /* stdio/vprintf.c */
-x_int x_vprintf __P((char *x_fmt, va_list x_ap));
+x_int x_vprintf __P((char *x_fmt, va_list x_argp));
 
 /* stdio/vsprintf.c */
-x_int x_vsprintf __P((char *x_str, char *x_fmt, va_list x_ap));
+x_int x_vsprintf __P((char *x_str, char *x_fmt, va_list x_argp));
 #endif
 
 #endif
index 8a34ede..1d112a3 100644 (file)
--- a/xify/x_.h
+++ b/xify/x_.h
@@ -1,9 +1,18 @@
 #ifndef X_
 #define X_
+
+#define _va_arg_short(argp) va_arg(argp, int)
+#define _va_arg_int(argp) va_arg(argp, int)
+#define _va_arg_long(argp) va_arg(argp, int)
+#define _va_arg_unsigned_short(argp) va_arg(argp, unsigned int)
+#define _va_arg_unsigned_int(argp) va_arg(argp, unsigned int)
+#define _va_arg_unsigned_long(argp) va_arg(argp, unsigned int)
+
 typedef short x_short;
 typedef int x_int;
 typedef int x_long;
 typedef unsigned short x_unsigned_short;
 typedef unsigned int x_unsigned_int;
 typedef unsigned int x_unsigned_long;
+
 #endif
index 7ebb309..b410925 100644 (file)
@@ -73,6 +73,7 @@ int main() {
         while (isalnum(p[l]) || p[l] == '_')
           ++l;
         if (
+          (l == 6 && memcmp(p, "extern", 6) == 0) ||
           (l == 8 && memcmp(p, "register", 8) == 0) ||
           (l == 6 && memcmp(p, "static", 6) == 0)
         ) {
@@ -99,7 +100,8 @@ int main() {
               (m != 6 || memcmp(q, "struct", 6) != 0) &&
               (m != 5 || memcmp(q, "union", 5) != 0) &&
               (m != 8 || memcmp(q, "unsigned", 8) != 0) &&
-              (m != 7 || memcmp(q, "va_list", 7) != 0)
+              (m != 7 || memcmp(q, "va_list", 7) != 0) &&
+              (m != 4 || memcmp(q, "void", 4) != 0)
             ) {
               q += m;
               m = 0;
diff --git a/xify/xify.sh b/xify/xify.sh
new file mode 100755 (executable)
index 0000000..c8161c6
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/sh
+"`dirname "$0"`/xify" |\
+sed -e 's/\(extern\|register\|static\) x_int \(x_u_long\|x_u_short\)/\1 \2/g; s/va_arg(x_argp, x_\(unsigned_\)\?\(short\|int\|long\))/_va_arg_\1\2(x_argp)/g'