From: Nick Downing Date: Thu, 19 Jan 2017 04:37:41 +0000 (+1100) Subject: Significant progress on getting libstdc to compile, fixed various missing or lax... X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=89a69fae067b9078e716c60529bc9d8481c3cac3;p=43bsd.git Significant progress on getting libstdc to compile, fixed various missing or lax declarations, conflicts, bugs in the conversion scripts, and so on --- diff --git a/cproto-4.6/grammar.y b/cproto-4.6/grammar.y index 8ed8f51..f4511d2 100644 --- a/cproto-4.6/grammar.y +++ b/cproto-4.6/grammar.y @@ -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); } diff --git a/cproto-4.6/lex.l b/cproto-4.6/lex.l index 8a55787..71513e4 100644 --- a/cproto-4.6/lex.l +++ b/cproto-4.6/lex.l @@ -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 diff --git a/lib/libstdc/assert.h b/lib/libstdc/assert.h index 35a6e88..89072b1 100644 --- a/lib/libstdc/assert.h +++ b/lib/libstdc/assert.h @@ -1,7 +1,6 @@ #ifndef _ASSERT_H_ #define _ASSERT_H_ -#include #include /* assert.h 4.2 85/01/21 */ diff --git a/lib/libstdc/compat-4.1.h b/lib/libstdc/compat-4.1.h index 1cdb38d..dac9dd4 100644 --- a/lib/libstdc/compat-4.1.h +++ b/lib/libstdc/compat-4.1.h @@ -3,8 +3,8 @@ #include #include -#include #include +#include #include #include #include diff --git a/lib/libstdc/compat-4.1/ftime.c b/lib/libstdc/compat-4.1/ftime.c index 3d48a09..87c49e1 100644 --- a/lib/libstdc/compat-4.1/ftime.c +++ b/lib/libstdc/compat-4.1/ftime.c @@ -1,6 +1,5 @@ -#include #include -#include +#include /* * Copyright (c) 1980 Regents of the University of California. @@ -12,20 +11,22 @@ static char sccsid[] = "@(#)ftime.c 5.2 (Berkeley) 3/9/86"; #endif -#include -#include +/*#include */ +/*#include */ +/*#include */ /* * Backwards compatible ftime. */ +/* we now get this from sys/timeb.h to avoid duplication */ /* from old timeb.h */ -struct timeb { - time_t time; - u_short millitm; - short timezone; - short dstflag; -}; +/*struct timeb {*/ +/* time_t time;*/ +/* u_short millitm;*/ +/* short timezone;*/ +/* short dstflag;*/ +/*};*/ int ftime(tp) register struct timeb *tp; { struct timeval t; diff --git a/lib/libstdc/compat-4.1/getpw.c b/lib/libstdc/compat-4.1/getpw.c index a8e8191..e8f29d8 100644 --- a/lib/libstdc/compat-4.1/getpw.c +++ b/lib/libstdc/compat-4.1/getpw.c @@ -11,7 +11,7 @@ static char sccsid[] = "@(#)getpw.c 5.2 (Berkeley) 3/9/86"; #endif -#include +/*#include */ int getpw(uid, buf) int uid; char buf[]; { static FILE *pwf; diff --git a/lib/libstdc/compat-4.1/gtty.c b/lib/libstdc/compat-4.1/gtty.c index 4819cc5..0793068 100644 --- a/lib/libstdc/compat-4.1/gtty.c +++ b/lib/libstdc/compat-4.1/gtty.c @@ -14,7 +14,7 @@ static char sccsid[] = "@(#)gtty.c 5.2 (Berkeley) 3/9/86"; * Writearound to old gtty system call. */ -#include +/*#include */ int gtty(fd, ap) int fd; struct sgttyb *ap; { diff --git a/lib/libstdc/compat-4.1/nice.c b/lib/libstdc/compat-4.1/nice.c index bc2978b..20b16d9 100644 --- a/lib/libstdc/compat-4.1/nice.c +++ b/lib/libstdc/compat-4.1/nice.c @@ -10,8 +10,8 @@ static char sccsid[] = "@(#)nice.c 5.2 (Berkeley) 3/9/86"; #endif -#include -#include +/*#include */ +/*#include */ /* * Backwards compatible nice. diff --git a/lib/libstdc/compat-4.1/stty.c b/lib/libstdc/compat-4.1/stty.c index a4951e0..dabc3f2 100644 --- a/lib/libstdc/compat-4.1/stty.c +++ b/lib/libstdc/compat-4.1/stty.c @@ -14,7 +14,7 @@ static char sccsid[] = "@(#)stty.c 5.2 (Berkeley) 3/9/86"; * Writearound to old stty system call. */ -#include +/*#include */ int stty(fd, ap) int fd; struct sgttyb *ap; { diff --git a/lib/libstdc/compat-4.1/times.c b/lib/libstdc/compat-4.1/times.c index fb363b0..78d89ed 100644 --- a/lib/libstdc/compat-4.1/times.c +++ b/lib/libstdc/compat-4.1/times.c @@ -12,8 +12,8 @@ static char sccsid[] = "@(#)times.c 5.2 (Berkeley) 3/9/86"; #endif -#include -#include +/*#include */ +/*#include */ /* * Backwards compatible times. diff --git a/lib/libstdc/compat-4.1/utime.c b/lib/libstdc/compat-4.1/utime.c index 1e2c122..8f80564 100644 --- a/lib/libstdc/compat-4.1/utime.c +++ b/lib/libstdc/compat-4.1/utime.c @@ -10,7 +10,7 @@ static char sccsid[] = "@(#)utime.c 5.2 (Berkeley) 3/9/86"; #endif -#include +/*#include */ /* * Backwards compatible utime. */ diff --git a/lib/libstdc/compat-4.1/vlimit.c b/lib/libstdc/compat-4.1/vlimit.c index 0361294..52aafa3 100644 --- a/lib/libstdc/compat-4.1/vlimit.c +++ b/lib/libstdc/compat-4.1/vlimit.c @@ -15,9 +15,9 @@ static char sccsid[] = "@(#)vlimit.c 5.2 (Berkeley) 3/9/86"; /* * (Almost) backwards compatible vlimit. */ -#include -#include -#include +/*#include */ +/*#include */ +/*#include */ /* LIM_NORAISE is not emulated */ #define LIM_NORAISE 0 /* if <> 0, can't raise limits */ diff --git a/lib/libstdc/compat-4.1/vtimes.c b/lib/libstdc/compat-4.1/vtimes.c index 37c5113..f9e53db 100644 --- a/lib/libstdc/compat-4.1/vtimes.c +++ b/lib/libstdc/compat-4.1/vtimes.c @@ -12,25 +12,27 @@ static char sccsid[] = "@(#)vtimes.c 5.2 (Berkeley) 3/9/86"; #endif -#include -#include +/*#include */ +/*#include */ +/*#include */ /* * Backwards compatible vtimes. */ -struct vtimes { - int vm_utime; /* user time (60'ths) */ - int vm_stime; /* system time (60'ths) */ +/* we now get this from sys/vtimes.h to avoid duplication */ +/*struct vtimes {*/ +/* int vm_utime;*/ /* user time (60'ths) */ +/* int vm_stime;*/ /* system time (60'ths) */ /* divide next two by utime+stime to get averages */ - unsigned vm_idsrss; /* integral of d+s rss */ - unsigned vm_ixrss; /* integral of text rss */ - int vm_maxrss; /* maximum rss */ - int vm_majflt; /* major page faults */ - int vm_minflt; /* minor page faults */ - int vm_nswap; /* number of swaps */ - int vm_inblk; /* block reads */ - int vm_oublk; /* block writes */ -}; +/* unsigned vm_idsrss;*/ /* integral of d+s rss */ +/* unsigned vm_ixrss;*/ /* integral of text rss */ +/* int vm_maxrss;*/ /* maximum rss */ +/* int vm_majflt;*/ /* major page faults */ +/* int vm_minflt;*/ /* minor page faults */ +/* int vm_nswap;*/ /* number of swaps */ +/* int vm_inblk;*/ /* block reads */ +/* int vm_oublk;*/ /* block writes */ +/*};*/ static getvtimes __P((register struct rusage *aru, register struct vtimes *avt)); static scale60 __P((register struct timeval *tvp)); diff --git a/lib/libstdc/compat-sys5/getopt.c b/lib/libstdc/compat-sys5/getopt.c index 3f4949e..d671494 100644 --- a/lib/libstdc/compat-sys5/getopt.c +++ b/lib/libstdc/compat-sys5/getopt.c @@ -12,7 +12,7 @@ static char sccsid[] = "@(#)getopt.c 4.3 (Berkeley) 3/9/86"; #endif -#include +/*#include */ /* * get option letter from argument vector diff --git a/lib/libstdc/conflicts.txt b/lib/libstdc/conflicts.txt index 92e9906..7e4415f 100644 --- a/lib/libstdc/conflicts.txt +++ b/lib/libstdc/conflicts.txt @@ -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 index 05596fb..0000000 --- a/lib/libstdc/csu.h +++ /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 index 6663ce0..0000000 --- a/lib/libstdc/csu/crt0.c +++ /dev/null @@ -1,116 +0,0 @@ -#include -#include -#include -#include - -/* - * 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 index b076d0a..0000000 --- a/lib/libstdc/csu/gmon.c +++ /dev/null @@ -1,291 +0,0 @@ -#include -#include -#include -#include -#include -#include - -/* - * 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 -#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 index 1b8263f..0000000 --- a/lib/libstdc/csu/mon.c +++ /dev/null @@ -1,166 +0,0 @@ -#include -#include -#include -#include - -/* - * 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 index 0000000..3186da7 --- /dev/null +++ b/lib/libstdc/errfunc.sh @@ -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 diff --git a/lib/libstdc/gen.h b/lib/libstdc/gen.h index 251b351..65a4bd6 100644 --- a/lib/libstdc/gen.h +++ b/lib/libstdc/gen.h @@ -14,7 +14,6 @@ #include #include #include -#include #include #include #include @@ -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)); diff --git a/lib/libstdc/gen/alarm.c b/lib/libstdc/gen/alarm.c index ae3e2c9..2163d4c 100644 --- a/lib/libstdc/gen/alarm.c +++ b/lib/libstdc/gen/alarm.c @@ -13,7 +13,7 @@ static char sccsid[] = "@(#)alarm.c 5.2 (Berkeley) 3/9/86"; /* * Backwards compatible alarm. */ -#include +/*#include */ int alarm(secs) int secs; { struct itimerval it, oitv; diff --git a/lib/libstdc/gen/closedir.c b/lib/libstdc/gen/closedir.c index 907e9c1..1ed9bd2 100644 --- a/lib/libstdc/gen/closedir.c +++ b/lib/libstdc/gen/closedir.c @@ -12,8 +12,8 @@ static char sccsid[] = "@(#)closedir.c 5.2 (Berkeley) 3/9/86"; #endif -#include -#include +/*#include */ +/*#include */ /* * close a directory. diff --git a/lib/libstdc/gen/ctime.c b/lib/libstdc/gen/ctime.c index fd01034..7eb9b73 100644 --- a/lib/libstdc/gen/ctime.c +++ b/lib/libstdc/gen/ctime.c @@ -46,9 +46,9 @@ static char sccsid[] = "@(#)ctime.c 5.5 (Berkeley) 3/9/86"; * ctime(t) just calls localtime, then asctime. */ -#include -#include -#include +/*#include */ +/*#include */ +/*#include */ static char cbuf[26]; static int dmsize[12] = { diff --git a/lib/libstdc/gen/ctype_.c b/lib/libstdc/gen/ctype_.c index dfa548c..e981d94 100644 --- a/lib/libstdc/gen/ctype_.c +++ b/lib/libstdc/gen/ctype_.c @@ -4,7 +4,7 @@ static char sccsid[] = "@(#)ctype_.c 5.4 (Berkeley) 3/9/86"; #endif -#include +/*#include */ char _ctype_[1 + 256] = { 0, diff --git a/lib/libstdc/gen/disktab.c b/lib/libstdc/gen/disktab.c index 3489afb..8978ce4 100644 --- a/lib/libstdc/gen/disktab.c +++ b/lib/libstdc/gen/disktab.c @@ -14,8 +14,8 @@ static char sccsid[] = "@(#)disktab.c 5.3 (Berkeley) 3/9/86"; #endif -#include -#include +/*#include */ +/*#include */ /*static char *dgetstr();*/ @@ -65,7 +65,7 @@ struct disktab *getdiskbyname(name) char *name; { return (dp); } -#include +/*#include */ static char *tbuf; /*static char *dskip();*/ diff --git a/lib/libstdc/gen/execvp.c b/lib/libstdc/gen/execvp.c index 9be5ef1..05eee41 100644 --- a/lib/libstdc/gen/execvp.c +++ b/lib/libstdc/gen/execvp.c @@ -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 +/*#include */ #define NULL 0 static char shell[] = "/bin/sh"; diff --git a/lib/libstdc/gen/fakcu.c b/lib/libstdc/gen/fakcu.c index f91ff0b..c0c3eed 100644 --- a/lib/libstdc/gen/fakcu.c +++ b/lib/libstdc/gen/fakcu.c @@ -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() { } diff --git a/lib/libstdc/gen/fstab.c b/lib/libstdc/gen/fstab.c index 3f2df3a..9d49213 100644 --- a/lib/libstdc/gen/fstab.c +++ b/lib/libstdc/gen/fstab.c @@ -13,9 +13,9 @@ static char sccsid[] = "@(#)fstab.c 5.2 (Berkeley) 3/9/86"; #endif -#include -#include -#include +/*#include */ +/*#include */ +/*#include */ static struct fstab fs; static char line[BUFSIZ+1]; diff --git a/lib/libstdc/gen/getgrent.c b/lib/libstdc/gen/getgrent.c index a826d56..626cf63 100644 --- a/lib/libstdc/gen/getgrent.c +++ b/lib/libstdc/gen/getgrent.c @@ -6,8 +6,8 @@ static char sccsid[] = "@(#)getgrent.c 5.2 (Berkeley) 3/9/86"; #endif -#include -#include +/*#include */ +/*#include */ #define MAXGRP 200 diff --git a/lib/libstdc/gen/getgrgid.c b/lib/libstdc/gen/getgrgid.c index e64682f..ed5e853 100644 --- a/lib/libstdc/gen/getgrgid.c +++ b/lib/libstdc/gen/getgrgid.c @@ -4,7 +4,7 @@ static char sccsid[] = "@(#)getgrgid.c 5.2 (Berkeley) 3/9/86"; #endif -#include +/*#include */ struct group *getgrgid(gid) register gid; { register struct group *p; diff --git a/lib/libstdc/gen/getgrnam.c b/lib/libstdc/gen/getgrnam.c index c964681..65c1b9f 100644 --- a/lib/libstdc/gen/getgrnam.c +++ b/lib/libstdc/gen/getgrnam.c @@ -5,7 +5,7 @@ static char sccsid[] = "@(#)getgrnam.c 5.2 (Berkeley) 3/9/86"; #endif -#include +/*#include */ struct group *getgrnam(name) register char *name; { register struct group *p; diff --git a/lib/libstdc/gen/getlogin.c b/lib/libstdc/gen/getlogin.c index bbb8822..2cc87f3 100644 --- a/lib/libstdc/gen/getlogin.c +++ b/lib/libstdc/gen/getlogin.c @@ -5,7 +5,7 @@ static char sccsid[] = "@(#)getlogin.c 5.3 (Berkeley) 5/9/86"; #endif -#include +/*#include */ static char UTMP[] = "/etc/utmp"; static struct utmp ubuf; diff --git a/lib/libstdc/gen/getpass.c b/lib/libstdc/gen/getpass.c index d2c1f3f..74fdf56 100644 --- a/lib/libstdc/gen/getpass.c +++ b/lib/libstdc/gen/getpass.c @@ -8,9 +8,9 @@ static char sccsid[] = "@(#)getpass.c 5.2 (Berkeley) 3/9/86"; #endif -#include -#include -#include +/*#include */ +/*#include */ +/*#include */ char *getpass(prompt) char *prompt; { struct sgttyb ttyb; diff --git a/lib/libstdc/gen/getpwent.c b/lib/libstdc/gen/getpwent.c index b3d20fa..d20a474 100644 --- a/lib/libstdc/gen/getpwent.c +++ b/lib/libstdc/gen/getpwent.c @@ -13,9 +13,9 @@ static char sccsid[] = "@(#)getpwent.c 5.2 (Berkeley) 3/9/86"; #endif -#include -#include -#include +/*#include */ +/*#include */ +/*#include */ static char EMPTY[] = ""; static FILE *pwf = NULL; diff --git a/lib/libstdc/gen/getpwnamuid.c b/lib/libstdc/gen/getpwnamuid.c index 29a922e..40f5028 100644 --- a/lib/libstdc/gen/getpwnamuid.c +++ b/lib/libstdc/gen/getpwnamuid.c @@ -15,11 +15,11 @@ static char sccsid[] = "@(#)getpwnamuid.c 5.2 (Berkeley) 3/9/86"; #endif -#include -#include -#include +/*#include */ +/*#include */ +/*#include */ -#include +/*#include */ static char line[BUFSIZ+1]; static struct passwd passwd; diff --git a/lib/libstdc/gen/getttyent.c b/lib/libstdc/gen/getttyent.c index 232a1fa..1a01c5d 100644 --- a/lib/libstdc/gen/getttyent.c +++ b/lib/libstdc/gen/getttyent.c @@ -12,9 +12,9 @@ static char sccsid[] = "@(#)getttyent.c 5.4 (Berkeley) 5/19/86"; #endif -#include -#include -#include +/*#include */ +/*#include */ +/*#include */ static char TTYFILE[] = "/etc/ttys"; static char zapchar; diff --git a/lib/libstdc/gen/getttynam.c b/lib/libstdc/gen/getttynam.c index 93d707e..2e499d0 100644 --- a/lib/libstdc/gen/getttynam.c +++ b/lib/libstdc/gen/getttynam.c @@ -11,7 +11,7 @@ static char sccsid[] = "@(#)getttynam.c 5.2 (Berkeley) 3/9/86"; #endif -#include +/*#include */ struct ttyent *getttynam(tty) char *tty; { register struct ttyent *t; diff --git a/lib/libstdc/gen/getusershell.c b/lib/libstdc/gen/getusershell.c index dcc5adb..7ef22da 100644 --- a/lib/libstdc/gen/getusershell.c +++ b/lib/libstdc/gen/getusershell.c @@ -14,11 +14,11 @@ static char sccsid[] = "@(#)getusershell.c 5.4 (Berkeley) 7/25/86"; #endif -#include -#include -#include -#include -#include +/*#include */ +/*#include */ +/*#include */ +/*#include */ +/*#include */ #define SHELLS "/etc/shells" diff --git a/lib/libstdc/gen/getwd.c b/lib/libstdc/gen/getwd.c index 4b574b6..022a443 100644 --- a/lib/libstdc/gen/getwd.c +++ b/lib/libstdc/gen/getwd.c @@ -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 -#include -#include +/*#include */ +/*#include */ +/*#include */ #define GETWDERR(s) strcpy(pathname, (s)); diff --git a/lib/libstdc/gen/initgroups.c b/lib/libstdc/gen/initgroups.c index 623c095..fab5ed1 100644 --- a/lib/libstdc/gen/initgroups.c +++ b/lib/libstdc/gen/initgroups.c @@ -18,9 +18,9 @@ static char sccsid[] = "@(#)initgroups.c 5.3 (Berkeley) 4/27/86"; /* * initgroups */ -#include -#include -#include +/*#include */ +/*#include */ +/*#include */ /*struct group *getgrent();*/ diff --git a/lib/libstdc/gen/insque.c b/lib/libstdc/gen/insque.c index 204aada..23d9a38 100644 --- a/lib/libstdc/gen/insque.c +++ b/lib/libstdc/gen/insque.c @@ -1,3 +1,5 @@ +#include + /* * 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 +/*#include */ /* * insque -- vax insque instruction diff --git a/lib/libstdc/gen/malloc.c b/lib/libstdc/gen/malloc.c index 3b827b7..185d4f5 100644 --- a/lib/libstdc/gen/malloc.c +++ b/lib/libstdc/gen/malloc.c @@ -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 +/*#include */ #define NULL 0 @@ -82,16 +82,16 @@ static int pagebucket; /* page size bucket */ * for a given block size. */ static u_int nmalloc[NBUCKETS]; -#include +/*#include */ #endif #if defined(DEBUG) || defined(RCHECK) #define ASSERT(p) if (!(p)) botch("p") -#include -static botch __P((char *s)); +/*#include */ +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, diff --git a/lib/libstdc/gen/mkstemp.c b/lib/libstdc/gen/mkstemp.c index 9ae25bd..c1b5c85 100644 --- a/lib/libstdc/gen/mkstemp.c +++ b/lib/libstdc/gen/mkstemp.c @@ -12,7 +12,7 @@ static char sccsid[] = "@(#)mkstemp.c 5.2 (Berkeley) 3/9/86"; #endif -#include +/*#include */ int mkstemp(as) char *as; { register char *s; diff --git a/lib/libstdc/gen/ndbm.c b/lib/libstdc/gen/ndbm.c index 808b6d8..02cead3 100644 --- a/lib/libstdc/gen/ndbm.c +++ b/lib/libstdc/gen/ndbm.c @@ -17,12 +17,12 @@ static char sccsid[] = "@(#)ndbm.c 5.3 (Berkeley) 3/9/86"; #endif -#include -#include -#include -#include -#include -#include +/*#include */ +/*#include */ +/*#include */ +/*#include */ +/*#include */ +/*#include */ #define BYTESIZ 8 #undef setbit diff --git a/lib/libstdc/gen/nlist.c b/lib/libstdc/gen/nlist.c index 3244730..4fd1be3 100644 --- a/lib/libstdc/gen/nlist.c +++ b/lib/libstdc/gen/nlist.c @@ -15,9 +15,9 @@ static char sccsid[] = "@(#)nlist.c 5.2 (Berkeley) 3/9/86"; #endif -#include -#include -#include +/*#include */ +/*#include */ +/*#include */ /* * nlist - retreive attributes from name list (string table version) diff --git a/lib/libstdc/gen/opendir.c b/lib/libstdc/gen/opendir.c index 03df69f..fe89d69 100644 --- a/lib/libstdc/gen/opendir.c +++ b/lib/libstdc/gen/opendir.c @@ -12,8 +12,8 @@ static char sccsid[] = "@(#)opendir.c 5.2 (Berkeley) 3/9/86"; #endif -#include -#include +/*#include */ +/*#include */ /* * open a directory. diff --git a/lib/libstdc/gen/perror.c b/lib/libstdc/gen/perror.c index f4fb948..7a2d1d4 100644 --- a/lib/libstdc/gen/perror.c +++ b/lib/libstdc/gen/perror.c @@ -16,8 +16,8 @@ static char sccsid[] = "@(#)perror.c 5.2 (Berkeley) 3/9/86"; * Print the error indicated * in the cerror cell. */ -#include -#include +/*#include */ +/*#include */ int errno; int sys_nerr; diff --git a/lib/libstdc/gen/psignal.c b/lib/libstdc/gen/psignal.c index 48eae46..8d8573a 100644 --- a/lib/libstdc/gen/psignal.c +++ b/lib/libstdc/gen/psignal.c @@ -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 +/*#include */ extern char *sys_siglist[]; diff --git a/lib/libstdc/gen/qsort.c b/lib/libstdc/gen/qsort.c index e9b38c8..fa7bc05 100644 --- a/lib/libstdc/gen/qsort.c +++ b/lib/libstdc/gen/qsort.c @@ -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; diff --git a/lib/libstdc/gen/random.c b/lib/libstdc/gen/random.c index f6da76b..c78922f 100644 --- a/lib/libstdc/gen/random.c +++ b/lib/libstdc/gen/random.c @@ -11,7 +11,7 @@ static char sccsid[] = "@(#)random.c 5.2 (Berkeley) 3/9/86"; #endif -#include +/*#include */ /* * 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; diff --git a/lib/libstdc/gen/readdir.c b/lib/libstdc/gen/readdir.c index 807ecbb..a873340 100644 --- a/lib/libstdc/gen/readdir.c +++ b/lib/libstdc/gen/readdir.c @@ -11,8 +11,8 @@ static char sccsid[] = "@(#)readdir.c 5.2 (Berkeley) 3/9/86"; #endif -#include -#include +/*#include */ +/*#include */ /* * get next entry in a directory. diff --git a/lib/libstdc/gen/remque.c b/lib/libstdc/gen/remque.c index ef34b19..372f834 100644 --- a/lib/libstdc/gen/remque.c +++ b/lib/libstdc/gen/remque.c @@ -1,3 +1,5 @@ +#include + /* * 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 +/*#include */ /* * remque -- vax remque instruction diff --git a/lib/libstdc/gen/scandir.c b/lib/libstdc/gen/scandir.c index 073e767..32087b0 100644 --- a/lib/libstdc/gen/scandir.c +++ b/lib/libstdc/gen/scandir.c @@ -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 -#include -#include +/*#include */ +/*#include */ +/*#include */ int scandir(dirname, namelist, select, dcomp) char *dirname; struct direct *(*namelist[]); int (*select)(); int (*dcomp)(); { register struct direct *d, *p, **names; diff --git a/lib/libstdc/gen/seekdir.c b/lib/libstdc/gen/seekdir.c index 6f698ed..342f156 100644 --- a/lib/libstdc/gen/seekdir.c +++ b/lib/libstdc/gen/seekdir.c @@ -11,8 +11,8 @@ static char sccsid[] = "@(#)seekdir.c 5.2 (Berkeley) 3/9/86"; #endif -#include -#include +/*#include */ +/*#include */ /* * seek to an entry in a directory. diff --git a/lib/libstdc/gen/siginterrupt.c b/lib/libstdc/gen/siginterrupt.c index 22cb5ab..67df098 100644 --- a/lib/libstdc/gen/siginterrupt.c +++ b/lib/libstdc/gen/siginterrupt.c @@ -10,7 +10,7 @@ static char sccsid[] = "@(#)siginterrupt.c 5.2 (Berkeley) 3/9/86"; #endif -#include +/*#include */ /* * Set signal state to prevent restart of system calls diff --git a/lib/libstdc/gen/siglist.c b/lib/libstdc/gen/siglist.c index 71d646d..102bef6 100644 --- a/lib/libstdc/gen/siglist.c +++ b/lib/libstdc/gen/siglist.c @@ -10,7 +10,7 @@ static char sccsid[] = "@(#)siglist.c 5.2 (Berkeley) 3/9/86"; #endif -#include +/*#include */ char *sys_siglist[NSIG] = { "Signal 0", diff --git a/lib/libstdc/gen/signal.c b/lib/libstdc/gen/signal.c index f1da9f4..a8a3d42 100644 --- a/lib/libstdc/gen/signal.c +++ b/lib/libstdc/gen/signal.c @@ -13,7 +13,7 @@ static char sccsid[] = "@(#)signal.c 5.2 (Berkeley) 3/9/86"; /* * Almost backwards compatible signal. */ -#include +/*#include */ int (*signal(s, a))() int s; int (*a)(); { struct sigvec osv, sv; diff --git a/lib/libstdc/gen/sleep.c b/lib/libstdc/gen/sleep.c index 1ea08e5..a9ad9d9 100644 --- a/lib/libstdc/gen/sleep.c +++ b/lib/libstdc/gen/sleep.c @@ -11,17 +11,17 @@ static char sccsid[] = "@(#)sleep.c 5.2 (Berkeley) 3/9/86"; #endif -#include -#include +/*#include */ +/*#include */ #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; } diff --git a/lib/libstdc/gen/syslog.c b/lib/libstdc/gen/syslog.c index 92646e5..71f77e0 100644 --- a/lib/libstdc/gen/syslog.c +++ b/lib/libstdc/gen/syslog.c @@ -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 -#include -#include -#include -#include -#include -#include +/*#include */ +/*#include */ +/*#include */ +/*#include */ +/*#include */ +/*#include */ +/*#include */ #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; } diff --git a/lib/libstdc/gen/system.c b/lib/libstdc/gen/system.c index bb41d76..f138762 100644 --- a/lib/libstdc/gen/system.c +++ b/lib/libstdc/gen/system.c @@ -7,7 +7,7 @@ static char sccsid[] = "@(#)system.c 5.2 (Berkeley) 3/9/86"; #endif -#include +/*#include */ int system(s) char *s; { int status, pid, w; diff --git a/lib/libstdc/gen/telldir.c b/lib/libstdc/gen/telldir.c index 841a348..01a2761 100644 --- a/lib/libstdc/gen/telldir.c +++ b/lib/libstdc/gen/telldir.c @@ -11,8 +11,8 @@ static char sccsid[] = "@(#)telldir.c 5.2 (Berkeley) 3/9/86"; #endif -#include -#include +/*#include */ +/*#include */ /* * return a pointer into a directory diff --git a/lib/libstdc/gen/time.c b/lib/libstdc/gen/time.c index 107777b..f8e66b2 100644 --- a/lib/libstdc/gen/time.c +++ b/lib/libstdc/gen/time.c @@ -14,8 +14,8 @@ static char sccsid[] = "@(#)time.c 5.3 (Berkeley) 3/9/86"; /* * Backwards compatible time call. */ -#include -#include +/*#include */ +/*#include */ long time(t) time_t *t; { struct timeval tt; diff --git a/lib/libstdc/gen/ttyname.c b/lib/libstdc/gen/ttyname.c index 7c1ac4b..49aad96 100644 --- a/lib/libstdc/gen/ttyname.c +++ b/lib/libstdc/gen/ttyname.c @@ -16,8 +16,8 @@ static char sccsid[] = "@(#)ttyname.c 5.2 (Berkeley) 3/9/86"; #define NULL 0 #include -#include -#include +/*#include */ +/*#include */ static char dev[] = "/dev/"; /*char *strcpy();*/ diff --git a/lib/libstdc/gen/ttyslot.c b/lib/libstdc/gen/ttyslot.c index f885177..e429f18 100644 --- a/lib/libstdc/gen/ttyslot.c +++ b/lib/libstdc/gen/ttyslot.c @@ -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 +/*#include */ /*char *ttyname();*/ /*char *rindex();*/ diff --git a/lib/libstdc/gen/ualarm.c b/lib/libstdc/gen/ualarm.c index 847cf51..22624f6 100644 --- a/lib/libstdc/gen/ualarm.c +++ b/lib/libstdc/gen/ualarm.c @@ -10,7 +10,7 @@ static char sccsid[] = "@(#)ualarm.c 5.2 (Berkeley) 3/9/86"; #endif -#include +/*#include */ #define USPS 1000000 /* # of microseconds in a second */ diff --git a/lib/libstdc/gen/usleep.c b/lib/libstdc/gen/usleep.c index e02b93c..e397535 100644 --- a/lib/libstdc/gen/usleep.c +++ b/lib/libstdc/gen/usleep.c @@ -11,8 +11,8 @@ static char sccsid[] = "@(#)usleep.c 5.2 (Berkeley) 3/9/86"; #endif -#include -#include +/*#include */ +/*#include */ #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; } diff --git a/lib/libstdc/groups.txt b/lib/libstdc/groups.txt index 96ba185..520f891 100644 --- a/lib/libstdc/groups.txt +++ b/lib/libstdc/groups.txt @@ -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 diff --git a/lib/libstdc/inet/inet_addr.c b/lib/libstdc/inet/inet_addr.c index c13b71e..f900f2a 100644 --- a/lib/libstdc/inet/inet_addr.c +++ b/lib/libstdc/inet/inet_addr.c @@ -13,9 +13,9 @@ static char sccsid[] = "@(#)inet_addr.c 5.2 (Berkeley) 3/9/86"; #endif -#include -#include -#include +/*#include */ +/*#include */ +/*#include */ /* * Internet address interpretation routine. diff --git a/lib/libstdc/inet/inet_lnaof.c b/lib/libstdc/inet/inet_lnaof.c index f68477d..2ef4e91 100644 --- a/lib/libstdc/inet/inet_lnaof.c +++ b/lib/libstdc/inet/inet_lnaof.c @@ -13,8 +13,8 @@ static char sccsid[] = "@(#)inet_lnaof.c 5.2 (Berkeley) 3/9/86"; #endif -#include -#include +/*#include */ +/*#include */ /* * Return the local network address portion of an diff --git a/lib/libstdc/inet/inet_makeaddr.c b/lib/libstdc/inet/inet_makeaddr.c index ffd9ec6..4e6c28a 100644 --- a/lib/libstdc/inet/inet_makeaddr.c +++ b/lib/libstdc/inet/inet_makeaddr.c @@ -13,8 +13,8 @@ static char sccsid[] = "@(#)inet_makeaddr.c 5.1 (Berkeley) 3/11/86"; #endif -#include -#include +/*#include */ +/*#include */ /* * Formulate an Internet address from network + host. Used in diff --git a/lib/libstdc/inet/inet_netof.c b/lib/libstdc/inet/inet_netof.c index 5d0ea7f..113bd7e 100644 --- a/lib/libstdc/inet/inet_netof.c +++ b/lib/libstdc/inet/inet_netof.c @@ -13,8 +13,8 @@ static char sccsid[] = "@(#)inet_netof.c 5.2 (Berkeley) 3/9/86"; #endif -#include -#include +/*#include */ +/*#include */ /* * Return the network number from an internet diff --git a/lib/libstdc/inet/inet_network.c b/lib/libstdc/inet/inet_network.c index 7a696c2..de90705 100644 --- a/lib/libstdc/inet/inet_network.c +++ b/lib/libstdc/inet/inet_network.c @@ -12,8 +12,8 @@ static char sccsid[] = "@(#)inet_network.c 5.2 (Berkeley) 3/9/86"; #endif -#include -#include +/*#include */ +/*#include */ /* * Internet network address interpretation routine. diff --git a/lib/libstdc/inet/inet_ntoa.c b/lib/libstdc/inet/inet_ntoa.c index 2b03d99..3d64d67 100644 --- a/lib/libstdc/inet/inet_ntoa.c +++ b/lib/libstdc/inet/inet_ntoa.c @@ -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 -#include +/*#include */ +/*#include */ char *inet_ntoa(in) struct in_addr in; { static char b[18]; diff --git a/lib/libstdc/libstdc.patch b/lib/libstdc/libstdc.patch index 5f5c599..9387a68 100644 --- a/lib/libstdc/libstdc.patch +++ b/lib/libstdc/libstdc.patch @@ -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 +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 + #include ++#include + + /* + * Backwards compatible ftime. + */ + ++/* we now get this from sys/timeb.h to avoid duplication */ + /* from old timeb.h */ +-struct timeb { +- time_t time; +- u_short millitm; +- short timezone; +- short dstflag; +-}; ++/*struct timeb {*/ ++/* time_t time;*/ ++/* u_short millitm;*/ ++/* short timezone;*/ ++/* short dstflag;*/ ++/*};*/ + + ftime(tp) + register struct timeb *tp; { diff --unified --recursive --new-file 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 @@ -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 @@ -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 + #include ++#include + + /* + * Backwards compatible vtimes. + */ +-struct vtimes { +- int vm_utime; /* user time (60'ths) */ +- int vm_stime; /* system time (60'ths) */ ++/* we now get this from sys/vtimes.h to avoid duplication */ ++/*struct vtimes {*/ ++/* int vm_utime;*/ /* user time (60'ths) */ ++/* int vm_stime;*/ /* system time (60'ths) */ + /* divide next two by utime+stime to get averages */ +- unsigned vm_idsrss; /* integral of d+s rss */ +- unsigned vm_ixrss; /* integral of text rss */ +- int vm_maxrss; /* maximum rss */ +- int vm_majflt; /* major page faults */ +- int vm_minflt; /* minor page faults */ +- int vm_nswap; /* number of swaps */ +- int vm_inblk; /* block reads */ +- int vm_oublk; /* block writes */ +-}; ++/* unsigned vm_idsrss;*/ /* integral of d+s rss */ ++/* unsigned vm_ixrss;*/ /* integral of text rss */ ++/* int vm_maxrss;*/ /* maximum rss */ ++/* int vm_majflt;*/ /* major page faults */ ++/* int vm_minflt;*/ /* minor page faults */ ++/* int vm_nswap;*/ /* number of swaps */ ++/* int vm_inblk;*/ /* block reads */ ++/* int vm_oublk;*/ /* block writes */ ++/*};*/ + + vtimes(par, chi) + register struct vtimes *par, *chi; { diff --unified --recursive --new-file 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 +- +-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 +-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 + +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 + +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 + +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 ++ ++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 + @@ -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 index 0000000..8fddadd --- /dev/null +++ b/lib/libstdc/mkpatch.sh @@ -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 index a1539d1..0000000 --- a/lib/libstdc/mp.h +++ /dev/null @@ -1,49 +0,0 @@ -#ifndef _MP_H_ -#define _MP_H_ - -#include -#include - -/* - * Copyright (c) 1980 Regents of the University of California. - * All rights reserved. The Berkeley software License Agreement - * specifies the terms and conditions for redistribution. - * - * @(#)mp.h 5.1 (Berkeley) 5/30/85 - */ - -#define MINT struct mint -MINT -{ int len; - short *val; -}; -#define FREE(x) {if(x.len!=0) {free((char *)x.val); x.len=0;}} -#ifndef DBG -#define shfree(u) free((char *)u) -#else -#include -#define shfree(u) { if(dbg) fprintf(stderr, "free %o\n", u); free((char *)u);} -extern int dbg; -#endif -#ifndef vax -struct half -{ short high; - short low; -}; -#else -struct half -{ short low; - short high; -}; -#endif -/*extern MINT *itom();*/ -/*extern short *xalloc();*/ - -#ifdef lint -extern xv_oid; -#define VOID xv_oid = -#else -#define VOID -#endif - -#endif diff --git a/lib/libstdc/n.sh b/lib/libstdc/n.sh index 1e99b3e..314ad04 100755 --- a/lib/libstdc/n.sh +++ b/lib/libstdc/n.sh @@ -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/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 diff --git a/lib/libstdc/net.h b/lib/libstdc/net.h index a0ec217..55d7a39 100644 --- a/lib/libstdc/net.h +++ b/lib/libstdc/net.h @@ -4,22 +4,24 @@ #include #include #include +#include /* 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 @@ -30,6 +32,18 @@ #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 diff --git a/lib/libstdc/net/getnetbyaddr.c b/lib/libstdc/net/getnetbyaddr.c index 8233575..38b3904 100644 --- a/lib/libstdc/net/getnetbyaddr.c +++ b/lib/libstdc/net/getnetbyaddr.c @@ -10,7 +10,7 @@ static char sccsid[] = "@(#)getnetbyaddr.c 5.3 (Berkeley) 5/19/86"; #endif -#include +/*#include */ extern int _net_stayopen; diff --git a/lib/libstdc/net/getnetbyname.c b/lib/libstdc/net/getnetbyname.c index e09de4b..e328218 100644 --- a/lib/libstdc/net/getnetbyname.c +++ b/lib/libstdc/net/getnetbyname.c @@ -11,7 +11,7 @@ static char sccsid[] = "@(#)getnetbyname.c 5.3 (Berkeley) 5/19/86"; #endif -#include +/*#include */ extern int _net_stayopen; diff --git a/lib/libstdc/net/getnetent.c b/lib/libstdc/net/getnetent.c index 3a8bd49..0cd6dfd 100644 --- a/lib/libstdc/net/getnetent.c +++ b/lib/libstdc/net/getnetent.c @@ -13,11 +13,11 @@ static char sccsid[] = "@(#)getnetent.c 5.3 (Berkeley) 5/19/86"; #endif -#include -#include -#include -#include -#include +/*#include */ +/*#include */ +/*#include */ +/*#include */ +/*#include */ #define MAXALIASES 35 diff --git a/lib/libstdc/net/getproto.c b/lib/libstdc/net/getproto.c index be04feb..2e3b13b 100644 --- a/lib/libstdc/net/getproto.c +++ b/lib/libstdc/net/getproto.c @@ -10,7 +10,7 @@ static char sccsid[] = "@(#)getproto.c 5.3 (Berkeley) 5/19/86"; #endif -#include +/*#include */ extern int _proto_stayopen; diff --git a/lib/libstdc/net/getprotoent.c b/lib/libstdc/net/getprotoent.c index 166e65e..4ec4e7a 100644 --- a/lib/libstdc/net/getprotoent.c +++ b/lib/libstdc/net/getprotoent.c @@ -12,11 +12,11 @@ static char sccsid[] = "@(#)getprotoent.c 5.3 (Berkeley) 5/19/86"; #endif -#include -#include -#include -#include -#include +/*#include */ +/*#include */ +/*#include */ +/*#include */ +/*#include */ #define MAXALIASES 35 diff --git a/lib/libstdc/net/getprotoname.c b/lib/libstdc/net/getprotoname.c index 01cc11c..7223866 100644 --- a/lib/libstdc/net/getprotoname.c +++ b/lib/libstdc/net/getprotoname.c @@ -11,7 +11,7 @@ static char sccsid[] = "@(#)getprotoname.c 5.3 (Berkeley) 5/19/86"; #endif -#include +/*#include */ extern int _proto_stayopen; diff --git a/lib/libstdc/net/getservbyname.c b/lib/libstdc/net/getservbyname.c index 733d9fb..3ac46d2 100644 --- a/lib/libstdc/net/getservbyname.c +++ b/lib/libstdc/net/getservbyname.c @@ -11,7 +11,7 @@ static char sccsid[] = "@(#)getservbyname.c 5.3 (Berkeley) 5/19/86"; #endif -#include +/*#include */ extern int _serv_stayopen; diff --git a/lib/libstdc/net/getservbyport.c b/lib/libstdc/net/getservbyport.c index 2529922..71b9720 100644 --- a/lib/libstdc/net/getservbyport.c +++ b/lib/libstdc/net/getservbyport.c @@ -11,7 +11,7 @@ static char sccsid[] = "@(#)getservbyport.c 5.3 (Berkeley) 5/19/86"; #endif -#include +/*#include */ extern int _serv_stayopen; diff --git a/lib/libstdc/net/getservent.c b/lib/libstdc/net/getservent.c index a227c4e..8bc3121 100644 --- a/lib/libstdc/net/getservent.c +++ b/lib/libstdc/net/getservent.c @@ -1,6 +1,6 @@ #include -#include #include +#include #include #include @@ -14,11 +14,11 @@ static char sccsid[] = "@(#)getservent.c 5.3 (Berkeley) 5/19/86"; #endif -#include -#include -#include -#include -#include +/*#include */ +/*#include */ +/*#include */ +/*#include */ +/*#include */ #define MAXALIASES 35 diff --git a/lib/libstdc/net/hosttable/gethostent.c b/lib/libstdc/net/hosttable/gethostent.c index 1578a41..b6b4778 100644 --- a/lib/libstdc/net/hosttable/gethostent.c +++ b/lib/libstdc/net/hosttable/gethostent.c @@ -15,12 +15,12 @@ static char sccsid[] = "@(#)gethostent.c 5.3 (Berkeley) 3/9/86"; #endif -#include -#include -#include -#include -#include -#include +/*#include */ +/*#include */ +/*#include */ +/*#include */ +/*#include */ +/*#include */ /* * Internet version. diff --git a/lib/libstdc/net/hosttable/gethostnamadr.c b/lib/libstdc/net/hosttable/gethostnamadr.c index abea174..18eeff6 100644 --- a/lib/libstdc/net/hosttable/gethostnamadr.c +++ b/lib/libstdc/net/hosttable/gethostnamadr.c @@ -16,11 +16,11 @@ static char sccsid[] = "@(#)gethostnamadr.c 5.5 (Berkeley) 3/9/86"; #endif -#include -#include -#include -#include -#include +/*#include */ +/*#include */ +/*#include */ +/*#include */ +/*#include */ #define MAXALIASES 35 diff --git a/lib/libstdc/net/htonl.c b/lib/libstdc/net/htonl.c index 25d3560..b19b4d6 100644 --- a/lib/libstdc/net/htonl.c +++ b/lib/libstdc/net/htonl.c @@ -2,7 +2,6 @@ #include #include -/*#include */ /*#include */ u_long htonl(hostlong) u_long hostlong; { abort(); diff --git a/lib/libstdc/net/htons.c b/lib/libstdc/net/htons.c index f56e85f..d791a01 100644 --- a/lib/libstdc/net/htons.c +++ b/lib/libstdc/net/htons.c @@ -2,8 +2,7 @@ #include #include -/*#include */ /*#include */ -u_short htons(hostshort) u_short hostshort; { +u_short htons(hostshort) int hostshort; { abort(); } diff --git a/lib/libstdc/net/named/gethostnamadr.c b/lib/libstdc/net/named/gethostnamadr.c index 4b4e4d2..fe1b225 100644 --- a/lib/libstdc/net/named/gethostnamadr.c +++ b/lib/libstdc/net/named/gethostnamadr.c @@ -2,8 +2,8 @@ #include #include #include -#include #include +#include #include #include #include @@ -22,16 +22,16 @@ static char sccsid[] = "@(#)gethostnamadr.c 6.12 (Berkeley) 5/19/86"; #endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +/*#include */ +/*#include */ +/*#include */ +/*#include */ +/*#include */ +/*#include */ +/*#include */ +/*#include */ +/*#include */ +/*#include */ #define MAXALIASES 35 #define MAXADDRS 35 diff --git a/lib/libstdc/net/named/sethostent.c b/lib/libstdc/net/named/sethostent.c index 9244907..53c7385 100644 --- a/lib/libstdc/net/named/sethostent.c +++ b/lib/libstdc/net/named/sethostent.c @@ -12,10 +12,10 @@ static char sccsid[] = "@(#)sethostent.c 6.3 (Berkeley) 4/10/86"; #endif -#include -#include -#include -#include +/*#include */ +/*#include */ +/*#include */ +/*#include */ int sethostent(stayopen) int stayopen; { if (stayopen) diff --git a/lib/libstdc/net/ntohl.c b/lib/libstdc/net/ntohl.c index ba34706..8caa668 100644 --- a/lib/libstdc/net/ntohl.c +++ b/lib/libstdc/net/ntohl.c @@ -2,7 +2,6 @@ #include #include -/*#include */ /*#include */ u_long ntohl(netlong) u_long netlong; { abort(); diff --git a/lib/libstdc/net/ntohs.c b/lib/libstdc/net/ntohs.c index 6471fe8..4546299 100644 --- a/lib/libstdc/net/ntohs.c +++ b/lib/libstdc/net/ntohs.c @@ -2,8 +2,7 @@ #include #include -/*#include */ /*#include */ -u_short ntohs(netshort) u_short netshort; { +u_short ntohs(netshort) int netshort; { abort(); } diff --git a/lib/libstdc/net/rcmd.c b/lib/libstdc/net/rcmd.c index 8373d55..32daf13 100644 --- a/lib/libstdc/net/rcmd.c +++ b/lib/libstdc/net/rcmd.c @@ -1,15 +1,15 @@ #include #include #include -#include #include +#include #include #include #include #include +#include #include #include -#include #include #include #include @@ -28,19 +28,19 @@ static char sccsid[] = "@(#)rcmd.c 5.11 (Berkeley) 5/6/86"; #endif -#include -#include -#include -#include -#include -#include -#include -#include +/*#include */ +/*#include */ +/*#include */ +/*#include */ +/*#include */ +/*#include */ +/*#include */ +/*#include */ -#include +/*#include */ -#include -#include +/*#include */ +/*#include */ extern errno; /*char *index(), *sprintf();*/ diff --git a/lib/libstdc/net/res_comp.c b/lib/libstdc/net/res_comp.c index 21641b6..b388a0c 100644 --- a/lib/libstdc/net/res_comp.c +++ b/lib/libstdc/net/res_comp.c @@ -11,9 +11,9 @@ static char sccsid[] = "@(#)res_comp.c 6.7 (Berkeley) 3/11/86"; #endif -#include -#include -#include +/*#include */ +/*#include */ +/*#include */ /* * Expand compressed domain name 'comp_dn' to full domain name. diff --git a/lib/libstdc/net/res_debug.c b/lib/libstdc/net/res_debug.c index 0228cdc..36d6386 100644 --- a/lib/libstdc/net/res_debug.c +++ b/lib/libstdc/net/res_debug.c @@ -20,10 +20,10 @@ static char sccsid[] = "@(#)res_debug.c 5.13 (Berkeley) 3/9/86"; #define DEBUG #endif -#include -#include -#include -#include +/*#include */ +/*#include */ +/*#include */ +/*#include */ /*extern char *p_cdname(), *p_rr(), *p_type(), *p_class();*/ /*extern char *inet_ntoa();*/ diff --git a/lib/libstdc/net/res_init.c b/lib/libstdc/net/res_init.c index 957f20e..cce3cf2 100644 --- a/lib/libstdc/net/res_init.c +++ b/lib/libstdc/net/res_init.c @@ -20,12 +20,12 @@ static char sccsid[] = "@(#)res_init.c 6.5 (Berkeley) 4/11/86"; #endif -#include -#include -#include -#include -#include -#include +/*#include */ +/*#include */ +/*#include */ +/*#include */ +/*#include */ +/*#include */ /* * Resolver configuration file. Contains the address of the diff --git a/lib/libstdc/net/res_mkquery.c b/lib/libstdc/net/res_mkquery.c index 0f4e2ac..01ecb96 100644 --- a/lib/libstdc/net/res_mkquery.c +++ b/lib/libstdc/net/res_mkquery.c @@ -16,11 +16,11 @@ static char sccsid[] = "@(#)res_mkquery.c 6.3 (Berkeley) 3/17/86"; #endif -#include -#include -#include -#include -#include +/*#include */ +/*#include */ +/*#include */ +/*#include */ +/*#include */ /*extern char *sprintf();*/ diff --git a/lib/libstdc/net/res_send.c b/lib/libstdc/net/res_send.c index d4c87a7..8ca652d 100644 --- a/lib/libstdc/net/res_send.c +++ b/lib/libstdc/net/res_send.c @@ -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 -#include -#include -#include -#include -#include -#include -#include -#include +/*#include */ +/*#include */ +/*#include */ +/*#include */ +/*#include */ +/*#include */ +/*#include */ +/*#include */ +/*#include */ extern int errno; diff --git a/lib/libstdc/net/rexec.c b/lib/libstdc/net/rexec.c index b5e2c9e..a6a05c4 100644 --- a/lib/libstdc/net/rexec.c +++ b/lib/libstdc/net/rexec.c @@ -1,6 +1,6 @@ #include -#include #include +#include #include #include #include @@ -20,14 +20,14 @@ static char sccsid[] = "@(#)rexec.c 5.2 (Berkeley) 3/9/86"; #endif -#include -#include +/*#include */ +/*#include */ -#include +/*#include */ -#include -#include -#include +/*#include */ +/*#include */ +/*#include */ extern errno; /*char *index(), *sprintf();*/ diff --git a/lib/libstdc/net/ruserpass.c b/lib/libstdc/net/ruserpass.c index a83af5a..abb9458 100644 --- a/lib/libstdc/net/ruserpass.c +++ b/lib/libstdc/net/ruserpass.c @@ -1,4 +1,3 @@ -#include #include #include #include @@ -20,20 +19,20 @@ static char sccsid[] = "@(#)ruserpass.c 5.2 (Berkeley) 3/9/86"; #endif -#include -#include -#include -#include -#include -#include +/*#include */ +/*#include */ +/*#include */ +/*#include */ +/*#include */ +/*#include */ /*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) { diff --git a/lib/libstdc/netinet/if_ether.h b/lib/libstdc/netinet/if_ether.h index fb3d97a..7cba51c 100644 --- a/lib/libstdc/netinet/if_ether.h +++ b/lib/libstdc/netinet/if_ether.h @@ -1,8 +1,8 @@ #ifndef _NETINET_IF_ETHER_H_ #define _NETINET_IF_ETHER_H_ -#include #include +#include #include #include diff --git a/lib/libstdc/netinet/in_pcb.h b/lib/libstdc/netinet/in_pcb.h index 693202e..8678eab 100644 --- a/lib/libstdc/netinet/in_pcb.h +++ b/lib/libstdc/netinet/in_pcb.h @@ -1,8 +1,8 @@ #ifndef _NETINET_IN_PCB_H_ #define _NETINET_IN_PCB_H_ -#include #include +#include #include /* diff --git a/lib/libstdc/netinet/tcp_debug.h b/lib/libstdc/netinet/tcp_debug.h index 732fc08..7fd7d9b 100644 --- a/lib/libstdc/netinet/tcp_debug.h +++ b/lib/libstdc/netinet/tcp_debug.h @@ -2,8 +2,8 @@ #define _NETINET_TCP_DEBUG_H_ #include -#include #include +#include #include /* diff --git a/lib/libstdc/netns/ns_pcb.h b/lib/libstdc/netns/ns_pcb.h index 2343846..ab46b82 100644 --- a/lib/libstdc/netns/ns_pcb.h +++ b/lib/libstdc/netns/ns_pcb.h @@ -1,8 +1,8 @@ #ifndef _NETNS_NS_PCB_H_ #define _NETNS_NS_PCB_H_ -#include #include +#include #include /* diff --git a/lib/libstdc/ns/ns_addr.c b/lib/libstdc/ns/ns_addr.c index 8fabb1c..330b55b 100644 --- a/lib/libstdc/ns/ns_addr.c +++ b/lib/libstdc/ns/ns_addr.c @@ -17,12 +17,12 @@ static char sccsid[] = "@(#)ns_addr.c 6.2 (Berkeley) 3/9/86"; #endif -#include -#include +/*#include */ +/*#include */ 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; diff --git a/lib/libstdc/ns/ns_ntoa.c b/lib/libstdc/ns/ns_ntoa.c index 41ca351..8a0462b 100644 --- a/lib/libstdc/ns/ns_ntoa.c +++ b/lib/libstdc/ns/ns_ntoa.c @@ -14,8 +14,8 @@ static char sccsid[] = "@(#)ns_ntoa.c 6.3 (Berkeley) 3/9/86"; #endif -#include -#include +/*#include */ +/*#include */ static char *spectHex __P((char *p0)); diff --git a/lib/libstdc/oldprotos.txt b/lib/libstdc/oldprotos.txt index 5fb37bc..9c0c1f8 100644 --- a/lib/libstdc/oldprotos.txt +++ b/lib/libstdc/oldprotos.txt @@ -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(); diff --git a/lib/libstdc/r.sh b/lib/libstdc/r.sh index 6bf6535..f4d9b2a 100755 --- a/lib/libstdc/r.sh +++ b/lib/libstdc/r.sh @@ -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 $/#ifdef __STDC__\n#include \n#endif/' + sed -e 's/.*/#include <&>/; s/^#include $/#ifdef __STDC__\n#include \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 $/#ifdef __STDC__\n#include \n#define _va_start(ap, arg) va_start(ap, arg)\n#else\n#include \n#define _va_start(ap, arg) va_start(ap)\n#endif/' + sed -e 's/.*/#include <&>/; s/^#include $/#ifdef __STDC__\n#include \n#define _va_start(argp, arg) va_start(argp, arg)\n#else\n#include \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 diff --git a/lib/libstdc/s.sh b/lib/libstdc/s.sh index 2fe77d3..44de0e2 100755 --- a/lib/libstdc/s.sh +++ b/lib/libstdc/s.sh @@ -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 diff --git a/lib/libstdc/stdio.h b/lib/libstdc/stdio.h index 2c42334..3d0b6f2 100644 --- a/lib/libstdc/stdio.h +++ b/lib/libstdc/stdio.h @@ -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 diff --git a/lib/libstdc/stdio/clrerr.c b/lib/libstdc/stdio/clrerr.c index dc11e4e..99234f3 100644 --- a/lib/libstdc/stdio/clrerr.c +++ b/lib/libstdc/stdio/clrerr.c @@ -4,7 +4,7 @@ static char sccsid[] = "@(#)clrerr.c 5.2 (Berkeley) 3/9/86"; #endif -#include +/*#include */ #undef clearerr int clearerr(iop) register FILE *iop; { diff --git a/lib/libstdc/stdio/doprnt.c b/lib/libstdc/stdio/doprnt.c index 67384db..8bab107 100644 --- a/lib/libstdc/stdio/doprnt.c +++ b/lib/libstdc/stdio/doprnt.c @@ -7,10 +7,10 @@ #include #ifdef __STDC__ #include -#define _va_start(ap, arg) va_start(ap, arg) +#define _va_start(argp, arg) va_start(argp, arg) #else #include -#define _va_start(ap, arg) va_start(ap) +#define _va_start(argp, arg) va_start(argp) #endif /* @@ -34,10 +34,10 @@ static char sccsid[] = "@(#)doprnt.c 5.35 (Berkeley) 6/27/88"; #endif -#include -#include -#include -#include +/*#include */ +/*#include */ +/*#include */ +/*#include */ /* 11-bit exponent (VAX G floating point) is 308 decimal digits */ #define MAXEXP 308 diff --git a/lib/libstdc/stdio/doscan.c b/lib/libstdc/stdio/doscan.c index a1ffe88..7a8f05d 100644 --- a/lib/libstdc/stdio/doscan.c +++ b/lib/libstdc/stdio/doscan.c @@ -3,19 +3,19 @@ #include #ifdef __STDC__ #include -#define _va_start(ap, arg) va_start(ap, arg) +#define _va_start(argp, arg) va_start(argp, arg) #else #include -#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 -#include -#include +/*#include */ +/*#include */ +/*#include */ #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; diff --git a/lib/libstdc/stdio/exit.c b/lib/libstdc/stdio/exit.c index f9ee999..54bf292 100644 --- a/lib/libstdc/stdio/exit.c +++ b/lib/libstdc/stdio/exit.c @@ -1,4 +1,3 @@ -#include #include #include #include diff --git a/lib/libstdc/stdio/fdopen.c b/lib/libstdc/stdio/fdopen.c index 3079a52..78b0148 100644 --- a/lib/libstdc/stdio/fdopen.c +++ b/lib/libstdc/stdio/fdopen.c @@ -18,9 +18,9 @@ static char sccsid[] = "@(#)fdopen.c 5.2 (Berkeley) 3/9/86"; * status */ -#include -#include -#include +/*#include */ +/*#include */ +/*#include */ FILE *fdopen(fd, mode) int fd; register char *mode; { extern FILE *_findiop(); diff --git a/lib/libstdc/stdio/fgetc.c b/lib/libstdc/stdio/fgetc.c index 7a33d9a..ad7235b 100644 --- a/lib/libstdc/stdio/fgetc.c +++ b/lib/libstdc/stdio/fgetc.c @@ -4,7 +4,7 @@ static char sccsid[] = "@(#)fgetc.c 5.2 (Berkeley) 3/9/86"; #endif -#include +/*#include */ int fgetc(fp) FILE *fp; { return(getc(fp)); diff --git a/lib/libstdc/stdio/fgets.c b/lib/libstdc/stdio/fgets.c index 542c92d..a43d2de 100644 --- a/lib/libstdc/stdio/fgets.c +++ b/lib/libstdc/stdio/fgets.c @@ -4,7 +4,7 @@ static char sccsid[] = "@(#)fgets.c 5.2 (Berkeley) 3/9/86"; #endif -#include +/*#include */ char *fgets(s, n, iop) char *s; int n; register FILE *iop; { register c; diff --git a/lib/libstdc/stdio/filbuf.c b/lib/libstdc/stdio/filbuf.c index d9f683c..d398dac 100644 --- a/lib/libstdc/stdio/filbuf.c +++ b/lib/libstdc/stdio/filbuf.c @@ -13,9 +13,9 @@ static char sccsid[] = "@(#)filbuf.c 5.3 (Berkeley) 3/9/86"; #endif -#include -#include -#include +/*#include */ +/*#include */ +/*#include */ /*char *malloc();*/ int _filbuf(iop) register FILE *iop; { diff --git a/lib/libstdc/stdio/findiop.c b/lib/libstdc/stdio/findiop.c index c8c10cf..7fdcfba 100644 --- a/lib/libstdc/stdio/findiop.c +++ b/lib/libstdc/stdio/findiop.c @@ -13,8 +13,8 @@ static char sccsid[] = "@(#)findiop.c 5.6 (Berkeley) 3/9/86"; #endif -#include -#include +/*#include */ +/*#include */ 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); diff --git a/lib/libstdc/stdio/flsbuf.c b/lib/libstdc/stdio/flsbuf.c index 940467a..4723b58 100644 --- a/lib/libstdc/stdio/flsbuf.c +++ b/lib/libstdc/stdio/flsbuf.c @@ -14,9 +14,9 @@ static char sccsid[] = "@(#)flsbuf.c 5.2 (Berkeley) 3/9/86"; #endif -#include -#include -#include +/*#include */ +/*#include */ +/*#include */ /*char *malloc();*/ diff --git a/lib/libstdc/stdio/fopen.c b/lib/libstdc/stdio/fopen.c index 33c4314..dc3460d 100644 --- a/lib/libstdc/stdio/fopen.c +++ b/lib/libstdc/stdio/fopen.c @@ -12,9 +12,9 @@ static char sccsid[] = "@(#)fopen.c 5.2 (Berkeley) 3/9/86"; #endif -#include -#include -#include +/*#include */ +/*#include */ +/*#include */ FILE *fopen(file, mode) char *file; register char *mode; { register FILE *iop; diff --git a/lib/libstdc/stdio/fprintf.c b/lib/libstdc/stdio/fprintf.c index 3c9c84d..76f69fa 100644 --- a/lib/libstdc/stdio/fprintf.c +++ b/lib/libstdc/stdio/fprintf.c @@ -1,10 +1,10 @@ #include #ifdef __STDC__ #include -#define _va_start(ap, arg) va_start(ap, arg) +#define _va_start(argp, arg) va_start(argp, arg) #else #include -#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 -#include +/*#include */ +/*#include */ #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); } diff --git a/lib/libstdc/stdio/fputc.c b/lib/libstdc/stdio/fputc.c index 035533d..2106d52 100644 --- a/lib/libstdc/stdio/fputc.c +++ b/lib/libstdc/stdio/fputc.c @@ -4,7 +4,7 @@ static char sccsid[] = "@(#)fputc.c 5.2 (Berkeley) 3/9/86"; #endif -#include +/*#include */ int fputc(c, fp) int c; register FILE *fp; { return(putc(c, fp)); diff --git a/lib/libstdc/stdio/fputs.c b/lib/libstdc/stdio/fputs.c index 9df1184..932dd05 100644 --- a/lib/libstdc/stdio/fputs.c +++ b/lib/libstdc/stdio/fputs.c @@ -10,7 +10,7 @@ static char sccsid[] = "@(#)fputs.c 5.2 (Berkeley) 3/9/86"; #endif -#include +/*#include */ int fputs(s, iop) register char *s; register FILE *iop; { register r = 0; diff --git a/lib/libstdc/stdio/fread.c b/lib/libstdc/stdio/fread.c index ed7c25f..32034dc 100644 --- a/lib/libstdc/stdio/fread.c +++ b/lib/libstdc/stdio/fread.c @@ -11,7 +11,7 @@ static char sccsid[] = "@(#)fread.c 5.2 (Berkeley) 3/9/86"; #endif -#include +/*#include */ int fread(ptr, size, count, iop) register char *ptr; unsigned size; unsigned count; register FILE *iop; { register int s; diff --git a/lib/libstdc/stdio/freopen.c b/lib/libstdc/stdio/freopen.c index 717dc9d..c73296d 100644 --- a/lib/libstdc/stdio/freopen.c +++ b/lib/libstdc/stdio/freopen.c @@ -12,9 +12,9 @@ static char sccsid[] = "@(#)freopen.c 5.2 (Berkeley) 3/9/86"; #endif -#include -#include -#include +/*#include */ +/*#include */ +/*#include */ FILE *freopen(file, mode, iop) char *file; register char *mode; register FILE *iop; { register f, rw, oflags; diff --git a/lib/libstdc/stdio/fseek.c b/lib/libstdc/stdio/fseek.c index c5e27cc..638142a 100644 --- a/lib/libstdc/stdio/fseek.c +++ b/lib/libstdc/stdio/fseek.c @@ -9,7 +9,7 @@ static char sccsid[] = "@(#)fseek.c 5.3 (Berkeley) 3/9/86"; * Seek for standard library. Coordinates with buffering. */ -#include +/*#include */ /*long lseek();*/ diff --git a/lib/libstdc/stdio/ftell.c b/lib/libstdc/stdio/ftell.c index 94e5ee5..6a94418 100644 --- a/lib/libstdc/stdio/ftell.c +++ b/lib/libstdc/stdio/ftell.c @@ -10,7 +10,7 @@ static char sccsid[] = "@(#)ftell.c 5.2 (Berkeley) 3/9/86"; * Coordinates with buffering. */ -#include +/*#include */ /*long lseek();*/ long ftell(iop) register FILE *iop; { diff --git a/lib/libstdc/stdio/fwrite.c b/lib/libstdc/stdio/fwrite.c index ec53e37..4afd737 100644 --- a/lib/libstdc/stdio/fwrite.c +++ b/lib/libstdc/stdio/fwrite.c @@ -11,7 +11,7 @@ static char sccsid[] = "@(#)fwrite.c 5.2 (Berkeley) 3/9/86"; #endif -#include +/*#include */ int fwrite(ptr, size, count, iop) register char *ptr; unsigned size; unsigned count; register FILE *iop; { register int s; diff --git a/lib/libstdc/stdio/getchar.c b/lib/libstdc/stdio/getchar.c index 5cf7f71..53fa8b0 100644 --- a/lib/libstdc/stdio/getchar.c +++ b/lib/libstdc/stdio/getchar.c @@ -7,7 +7,7 @@ static char sccsid[] = "@(#)getchar.c 5.2 (Berkeley) 3/9/86"; /* * A subroutine version of the macro getchar. */ -#include +/*#include */ #undef getchar diff --git a/lib/libstdc/stdio/gets.c b/lib/libstdc/stdio/gets.c index bdfbc9b..73e5ecb 100644 --- a/lib/libstdc/stdio/gets.c +++ b/lib/libstdc/stdio/gets.c @@ -4,7 +4,7 @@ static char sccsid[] = "@(#)gets.c 5.2 (Berkeley) 3/9/86"; #endif -#include +/*#include */ char *gets(s) char *s; { register c; diff --git a/lib/libstdc/stdio/getw.c b/lib/libstdc/stdio/getw.c index fcfe6e8..187e43d 100644 --- a/lib/libstdc/stdio/getw.c +++ b/lib/libstdc/stdio/getw.c @@ -4,7 +4,7 @@ static char sccsid[] = "@(#)getw.c 5.2 (Berkeley) 3/9/86"; #endif -#include +/*#include */ int getw(iop) register FILE *iop; { register i; diff --git a/lib/libstdc/stdio/popen.c b/lib/libstdc/stdio/popen.c index d0c1479..a9c8c5e 100644 --- a/lib/libstdc/stdio/popen.c +++ b/lib/libstdc/stdio/popen.c @@ -16,8 +16,8 @@ static char sccsid[] = "@(#)popen.c 5.4 (Berkeley) 3/26/86"; #endif -#include -#include +/*#include */ +/*#include */ #define tst(a,b) (*mode == 'r'? (b) : (a)) #define RDR 0 diff --git a/lib/libstdc/stdio/printf.c b/lib/libstdc/stdio/printf.c index c173835..f2fdfd1 100644 --- a/lib/libstdc/stdio/printf.c +++ b/lib/libstdc/stdio/printf.c @@ -1,10 +1,10 @@ #include #ifdef __STDC__ #include -#define _va_start(ap, arg) va_start(ap, arg) +#define _va_start(argp, arg) va_start(argp, arg) #else #include -#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 -#include +/*#include */ +/*#include */ #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); } diff --git a/lib/libstdc/stdio/putchar.c b/lib/libstdc/stdio/putchar.c index 7c65b4a..9a63dc1 100644 --- a/lib/libstdc/stdio/putchar.c +++ b/lib/libstdc/stdio/putchar.c @@ -7,7 +7,7 @@ static char sccsid[] = "@(#)putchar.c 5.2 (Berkeley) 3/9/86"; /* * A subroutine version of the macro putchar */ -#include +/*#include */ #undef putchar diff --git a/lib/libstdc/stdio/puts.c b/lib/libstdc/stdio/puts.c index 9664963..a0e1669 100644 --- a/lib/libstdc/stdio/puts.c +++ b/lib/libstdc/stdio/puts.c @@ -4,7 +4,7 @@ static char sccsid[] = "@(#)puts.c 5.2 (Berkeley) 3/9/86"; #endif -#include +/*#include */ int puts(s) register char *s; { register c; diff --git a/lib/libstdc/stdio/putw.c b/lib/libstdc/stdio/putw.c index 839fdef..d307535 100644 --- a/lib/libstdc/stdio/putw.c +++ b/lib/libstdc/stdio/putw.c @@ -4,7 +4,7 @@ static char sccsid[] = "@(#)putw.c 5.2 (Berkeley) 3/9/86"; #endif -#include +/*#include */ int putw(w, iop) int w; register FILE *iop; { register char *p; diff --git a/lib/libstdc/stdio/rew.c b/lib/libstdc/stdio/rew.c index 2f54eaf..6ced2c1 100644 --- a/lib/libstdc/stdio/rew.c +++ b/lib/libstdc/stdio/rew.c @@ -5,7 +5,7 @@ static char sccsid[] = "@(#)rew.c 5.2 (Berkeley) 3/9/86"; #endif -#include +/*#include */ int rewind(iop) register FILE *iop; { fflush(iop); diff --git a/lib/libstdc/stdio/scanf.c b/lib/libstdc/stdio/scanf.c index 0f060cf..d43cdf7 100644 --- a/lib/libstdc/stdio/scanf.c +++ b/lib/libstdc/stdio/scanf.c @@ -1,18 +1,18 @@ #include #ifdef __STDC__ #include -#define _va_start(ap, arg) va_start(ap, arg) +#define _va_start(argp, arg) va_start(argp, arg) #else #include -#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 -#include +/*#include */ +/*#include */ #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; } diff --git a/lib/libstdc/stdio/setbuf.c b/lib/libstdc/stdio/setbuf.c index 1b895bb..c51b025 100644 --- a/lib/libstdc/stdio/setbuf.c +++ b/lib/libstdc/stdio/setbuf.c @@ -11,7 +11,7 @@ static char sccsid[] = "@(#)setbuf.c 5.2 (Berkeley) 3/9/86"; #endif -#include +/*#include */ int setbuf(iop, buf) register FILE *iop; char *buf; { if (iop->_base != NULL && iop->_flag&_IOMYBUF) diff --git a/lib/libstdc/stdio/setbuffer.c b/lib/libstdc/stdio/setbuffer.c index f759878..4cb3cd0 100644 --- a/lib/libstdc/stdio/setbuffer.c +++ b/lib/libstdc/stdio/setbuffer.c @@ -11,7 +11,7 @@ static char sccsid[] = "@(#)setbuffer.c 5.2 (Berkeley) 3/9/86"; #endif -#include +/*#include */ int setbuffer(iop, buf, size) register FILE *iop; char *buf; int size; { if (iop->_base != NULL && iop->_flag&_IOMYBUF) diff --git a/lib/libstdc/stdio/sibuf.c b/lib/libstdc/stdio/sibuf.c index 6b93835..b749e84 100644 --- a/lib/libstdc/stdio/sibuf.c +++ b/lib/libstdc/stdio/sibuf.c @@ -4,6 +4,6 @@ static char sccsid[] = "@(#)sibuf.c 5.2 (Berkeley) 3/9/86"; #endif -#include +/*#include */ char _sibuf[BUFSIZ]; diff --git a/lib/libstdc/stdio/sobuf.c b/lib/libstdc/stdio/sobuf.c index db58746..dee91d1 100644 --- a/lib/libstdc/stdio/sobuf.c +++ b/lib/libstdc/stdio/sobuf.c @@ -4,6 +4,6 @@ static char sccsid[] = "@(#)sobuf.c 5.2 (Berkeley) 3/9/86"; #endif -#include +/*#include */ char _sobuf[BUFSIZ]; diff --git a/lib/libstdc/stdio/sprintf.c b/lib/libstdc/stdio/sprintf.c index 029bebd..7403f05 100644 --- a/lib/libstdc/stdio/sprintf.c +++ b/lib/libstdc/stdio/sprintf.c @@ -1,10 +1,10 @@ #include #ifdef __STDC__ #include -#define _va_start(ap, arg) va_start(ap, arg) +#define _va_start(argp, arg) va_start(argp, arg) #else #include -#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 -#include +/*#include */ +/*#include */ #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); } diff --git a/lib/libstdc/stdio/strout.c b/lib/libstdc/stdio/strout.c index c7579b7..520cb33 100644 --- a/lib/libstdc/stdio/strout.c +++ b/lib/libstdc/stdio/strout.c @@ -4,7 +4,7 @@ static char sccsid[] = "@(#)strout.c 5.2 (Berkeley) 3/9/86"; #endif -#include +/*#include */ int _strout(count, string, adjust, file, fillch) register count; register char *string; int adjust; register FILE *file; int fillch; { while (adjust < 0) { diff --git a/lib/libstdc/stdio/ungetc.c b/lib/libstdc/stdio/ungetc.c index f021a4f..c041c3d 100644 --- a/lib/libstdc/stdio/ungetc.c +++ b/lib/libstdc/stdio/ungetc.c @@ -4,7 +4,7 @@ static char sccsid[] = "@(#)ungetc.c 5.3 (Berkeley) 3/26/86"; #endif -#include +/*#include */ int ungetc(c, iop) int c; register FILE *iop; { if (c == EOF || (iop->_flag & (_IOREAD|_IORW)) == 0 || diff --git a/lib/libstdc/stdio/vfprintf.c b/lib/libstdc/stdio/vfprintf.c index 79adc6a..300a166 100644 --- a/lib/libstdc/stdio/vfprintf.c +++ b/lib/libstdc/stdio/vfprintf.c @@ -1,10 +1,10 @@ #include #ifdef __STDC__ #include -#define _va_start(ap, arg) va_start(ap, arg) +#define _va_start(argp, arg) va_start(argp, arg) #else #include -#define _va_start(ap, arg) va_start(ap) +#define _va_start(argp, arg) va_start(argp) #endif /* @@ -28,24 +28,24 @@ static char sccsid[] = "@(#)vfprintf.c 5.2 (Berkeley) 6/27/88"; #endif -#include -#include +/*#include */ +/*#include */ -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); } diff --git a/lib/libstdc/stdio/vprintf.c b/lib/libstdc/stdio/vprintf.c index eb1a154..2c72c95 100644 --- a/lib/libstdc/stdio/vprintf.c +++ b/lib/libstdc/stdio/vprintf.c @@ -1,10 +1,10 @@ #include #ifdef __STDC__ #include -#define _va_start(ap, arg) va_start(ap, arg) +#define _va_start(argp, arg) va_start(argp, arg) #else #include -#define _va_start(ap, arg) va_start(ap) +#define _va_start(argp, arg) va_start(argp) #endif /* @@ -28,12 +28,12 @@ static char sccsid[] = "@(#)vprintf.c 5.2 (Berkeley) 6/27/88"; #endif -#include -#include +/*#include */ +/*#include */ -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); } diff --git a/lib/libstdc/stdio/vsprintf.c b/lib/libstdc/stdio/vsprintf.c index c42ab59..1b8f648 100644 --- a/lib/libstdc/stdio/vsprintf.c +++ b/lib/libstdc/stdio/vsprintf.c @@ -1,10 +1,10 @@ #include #ifdef __STDC__ #include -#define _va_start(ap, arg) va_start(ap, arg) +#define _va_start(argp, arg) va_start(argp, arg) #else #include -#define _va_start(ap, arg) va_start(ap) +#define _va_start(argp, arg) va_start(argp) #endif /* @@ -28,17 +28,17 @@ static char sccsid[] = "@(#)vsprintf.c 5.2 (Berkeley) 6/27/88"; #endif -#include -#include +/*#include */ +/*#include */ -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); } diff --git a/lib/libstdc/sys/ioctl.h b/lib/libstdc/sys/ioctl.h index 65a3832..23fb9ef 100644 --- a/lib/libstdc/sys/ioctl.h +++ b/lib/libstdc/sys/ioctl.h @@ -1,8 +1,8 @@ #ifndef _SYS_IOCTL_H_ #define _SYS_IOCTL_H_ -#include #include +#include #include #include @@ -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 diff --git a/lib/libstdc/gen/isatty.c b/lib/libstdc/sys/isatty.c similarity index 92% rename from lib/libstdc/gen/isatty.c rename to lib/libstdc/sys/isatty.c index cd41d93..77fdcdb 100644 --- a/lib/libstdc/gen/isatty.c +++ b/lib/libstdc/sys/isatty.c @@ -8,7 +8,7 @@ static char sccsid[] = "@(#)isatty.c 5.2 (Berkeley) 3/9/86"; * Returns 1 iff file is a tty */ -#include +/*#include */ int isatty(f) int f; { struct sgttyb ttyb; diff --git a/lib/libstdc/sys/namei.h b/lib/libstdc/sys/namei.h index 21cc439..1557267 100644 --- a/lib/libstdc/sys/namei.h +++ b/lib/libstdc/sys/namei.h @@ -19,7 +19,7 @@ #ifdef KERNEL #include "uio.h" #else -#include +/*#include */ #endif /* diff --git a/lib/libstdc/sys/param.h b/lib/libstdc/sys/param.h index 22490ac..cb0b8ff 100644 --- a/lib/libstdc/sys/param.h +++ b/lib/libstdc/sys/param.h @@ -106,7 +106,7 @@ #define CROUND (CBLOCK - 1) /* clist rounding */ #ifndef KERNEL -#include +/*#include */ #else #ifndef LOCORE #include "types.h" diff --git a/lib/libstdc/sys/proc.h b/lib/libstdc/sys/proc.h index 1d9809f..87b2d7c 100644 --- a/lib/libstdc/sys/proc.h +++ b/lib/libstdc/sys/proc.h @@ -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 diff --git a/lib/libstdc/sys/syslog.h b/lib/libstdc/sys/syslog.h index 964f2f3..6454a3d 100644 --- a/lib/libstdc/sys/syslog.h +++ b/lib/libstdc/sys/syslog.h @@ -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 diff --git a/lib/libstdc/sys/tablet.h b/lib/libstdc/sys/tablet.h index b333556..9ba4fd0 100644 --- a/lib/libstdc/sys/tablet.h +++ b/lib/libstdc/sys/tablet.h @@ -18,7 +18,7 @@ #ifdef KERNEL #include "../h/ioctl.h" #else -#include +/*#include */ #endif /* diff --git a/lib/libstdc/sys/time.h b/lib/libstdc/sys/time.h index 818af8f..284fd44 100644 --- a/lib/libstdc/sys/time.h +++ b/lib/libstdc/sys/time.h @@ -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)); diff --git a/lib/libstdc/sys/tty.h b/lib/libstdc/sys/tty.h index 94c95a0..ae17cc1 100644 --- a/lib/libstdc/sys/tty.h +++ b/lib/libstdc/sys/tty.h @@ -17,7 +17,7 @@ #include "ttychars.h" #include "ttydev.h" #else -#include +/*#include */ #include #endif diff --git a/lib/libstdc/sys/user.h b/lib/libstdc/sys/user.h index 1de262d..f467b13 100644 --- a/lib/libstdc/sys/user.h +++ b/lib/libstdc/sys/user.h @@ -26,10 +26,10 @@ #include "namei.h" #else #include -#include -#include -#include -#include +/*#include */ +/*#include */ +/*#include */ +/*#include */ #endif /* diff --git a/lib/libstdc/sys/vcmd.h b/lib/libstdc/sys/vcmd.h index ede48f9..7e8391b 100644 --- a/lib/libstdc/sys/vcmd.h +++ b/lib/libstdc/sys/vcmd.h @@ -15,7 +15,7 @@ #ifdef KERNEL #include "ioctl.h" #else -#include +/*#include */ #endif #endif diff --git a/lib/libstdc/sys/vfork.c b/lib/libstdc/sys/vfork.c new file mode 100644 index 0000000..f1b60ad --- /dev/null +++ b/lib/libstdc/sys/vfork.c @@ -0,0 +1,6 @@ +#include +#include + +int vfork() { + abort(); +} diff --git a/lib/libstdc/unported.txt b/lib/libstdc/unported.txt index 96d5ecb..3943dc8 100644 --- a/lib/libstdc/unported.txt +++ b/lib/libstdc/unported.txt @@ -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 diff --git a/lib/libstdc/vaxuba/rxreg.h b/lib/libstdc/vaxuba/rxreg.h index 4f65e44..3eeb202 100644 --- a/lib/libstdc/vaxuba/rxreg.h +++ b/lib/libstdc/vaxuba/rxreg.h @@ -14,7 +14,7 @@ #ifdef KERNEL #include "ioctl.h" #else -#include +/*#include */ #endif /* diff --git a/x_include/netinet/x_if_ether.h b/x_include/netinet/x_if_ether.h index 9495d26..d2d937e 100644 --- a/x_include/netinet/x_if_ether.h +++ b/x_include/netinet/x_if_ether.h @@ -3,8 +3,8 @@ #ifndef x__NETINET_IF_ETHER_H_ #define x__NETINET_IF_ETHER_H_ -#include #include +#include #include #include diff --git a/x_include/netinet/x_in_pcb.h b/x_include/netinet/x_in_pcb.h index eaca804..d14b02f 100644 --- a/x_include/netinet/x_in_pcb.h +++ b/x_include/netinet/x_in_pcb.h @@ -3,8 +3,8 @@ #ifndef x__NETINET_IN_PCB_H_ #define x__NETINET_IN_PCB_H_ -#include #include +#include #include /* diff --git a/x_include/netinet/x_tcp_debug.h b/x_include/netinet/x_tcp_debug.h index c96a7ec..cb6f564 100644 --- a/x_include/netinet/x_tcp_debug.h +++ b/x_include/netinet/x_tcp_debug.h @@ -4,8 +4,8 @@ #define x__NETINET_TCP_DEBUG_H_ #include -#include #include +#include #include /* diff --git a/x_include/netns/x_ns_pcb.h b/x_include/netns/x_ns_pcb.h index 0bf0d22..a03f5cf 100644 --- a/x_include/netns/x_ns_pcb.h +++ b/x_include/netns/x_ns_pcb.h @@ -3,8 +3,8 @@ #ifndef x__NETNS_NS_PCB_H_ #define x__NETNS_NS_PCB_H_ -#include #include +#include #include /* diff --git a/x_include/sys/x_ioctl.h b/x_include/sys/x_ioctl.h index 0716c28..2102c56 100644 --- a/x_include/sys/x_ioctl.h +++ b/x_include/sys/x_ioctl.h @@ -3,8 +3,8 @@ #ifndef x__SYS_IOCTL_H_ #define x__SYS_IOCTL_H_ -#include #include +#include #include #include @@ -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 diff --git a/x_include/sys/x_kernel.h b/x_include/sys/x_kernel.h index 73b7368..c9d21eb 100644 --- a/x_include/sys/x_kernel.h +++ b/x_include/sys/x_kernel.h @@ -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 diff --git a/x_include/sys/x_namei.h b/x_include/sys/x_namei.h index e70d454..bfd9dfd 100644 --- a/x_include/sys/x_namei.h +++ b/x_include/sys/x_namei.h @@ -21,7 +21,7 @@ #ifdef x_KERNEL #include "x_uio.h" #else -#include +/*#include */ #endif /* diff --git a/x_include/sys/x_param.h b/x_include/sys/x_param.h index 08b5774..4500e1a 100644 --- a/x_include/sys/x_param.h +++ b/x_include/sys/x_param.h @@ -108,7 +108,7 @@ #define x_CROUND (x_CBLOCK - 1) /* clist rounding */ #ifndef x_KERNEL -#include +/*#include */ #else #ifndef x_LOCORE #include "x_types.h" diff --git a/x_include/sys/x_proc.h b/x_include/sys/x_proc.h index f2d2611..923b4ba 100644 --- a/x_include/sys/x_proc.h +++ b/x_include/sys/x_proc.h @@ -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 diff --git a/x_include/sys/x_syslog.h b/x_include/sys/x_syslog.h index 7d5e271..f0089a7 100644 --- a/x_include/sys/x_syslog.h +++ b/x_include/sys/x_syslog.h @@ -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 diff --git a/x_include/sys/x_tablet.h b/x_include/sys/x_tablet.h index a56c83d..9dd9e33 100644 --- a/x_include/sys/x_tablet.h +++ b/x_include/sys/x_tablet.h @@ -20,7 +20,7 @@ #ifdef x_KERNEL #include "../h/x_ioctl.h" #else -#include +/*#include */ #endif /* diff --git a/x_include/sys/x_time.h b/x_include/sys/x_time.h index f34975b..7399645 100644 --- a/x_include/sys/x_time.h +++ b/x_include/sys/x_time.h @@ -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)); diff --git a/x_include/sys/x_tty.h b/x_include/sys/x_tty.h index 48037d9..7f4921e 100644 --- a/x_include/sys/x_tty.h +++ b/x_include/sys/x_tty.h @@ -19,7 +19,7 @@ #include "x_ttychars.h" #include "x_ttydev.h" #else -#include +/*#include */ #include #endif diff --git a/x_include/sys/x_user.h b/x_include/sys/x_user.h index a4f1b5c..46990ca 100644 --- a/x_include/sys/x_user.h +++ b/x_include/sys/x_user.h @@ -28,10 +28,10 @@ #include "x_namei.h" #else #include -#include -#include -#include -#include +/*#include */ +/*#include */ +/*#include */ +/*#include */ #endif /* diff --git a/x_include/sys/x_vcmd.h b/x_include/sys/x_vcmd.h index 9defad5..19ce51a 100644 --- a/x_include/sys/x_vcmd.h +++ b/x_include/sys/x_vcmd.h @@ -17,7 +17,7 @@ #ifdef x_KERNEL #include "x_ioctl.h" #else -#include +/*#include */ #endif #endif diff --git a/x_include/vaxuba/x_rxreg.h b/x_include/vaxuba/x_rxreg.h index f7e113b..843b84a 100644 --- a/x_include/vaxuba/x_rxreg.h +++ b/x_include/vaxuba/x_rxreg.h @@ -16,7 +16,7 @@ #ifdef x_KERNEL #include "x_ioctl.h" #else -#include +/*#include */ #endif /* diff --git a/x_include/x_.h b/x_include/x_.h index b3e7c20..1d112a3 100644 --- a/x_include/x_.h +++ b/x_include/x_.h @@ -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 diff --git a/x_include/x_assert.h b/x_include/x_assert.h index 7f57832..331e8e0 100644 --- a/x_include/x_assert.h +++ b/x_include/x_assert.h @@ -3,7 +3,6 @@ #ifndef x__ASSERT_H_ #define x__ASSERT_H_ -#include #include /* assert.h 4.2 85/01/21 */ diff --git a/x_include/x_compat-4.1.h b/x_include/x_compat-4.1.h index 571f379..8ceba70 100644 --- a/x_include/x_compat-4.1.h +++ b/x_include/x_compat-4.1.h @@ -5,8 +5,8 @@ #include #include -#include #include +#include #include #include #include diff --git a/x_include/x_csu.h b/x_include/x_csu.h deleted file mode 100644 index b2bb791..0000000 --- a/x_include/x_csu.h +++ /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 diff --git a/x_include/x_gen.h b/x_include/x_gen.h index f1876ca..a970980 100644 --- a/x_include/x_gen.h +++ b/x_include/x_gen.h @@ -16,7 +16,6 @@ #include #include #include -#include #include #include #include @@ -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 index 555ecd3..0000000 --- a/x_include/x_mp.h +++ /dev/null @@ -1,51 +0,0 @@ -#include "x_.h" - -#ifndef x__MP_H_ -#define x__MP_H_ - -#include -#include - -/* - * 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 -#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 diff --git a/x_include/x_net.h b/x_include/x_net.h index 780e04a..1e04e0f 100644 --- a/x_include/x_net.h +++ b/x_include/x_net.h @@ -6,22 +6,24 @@ #include #include #include +#include /* 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 @@ -32,6 +34,18 @@ #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 diff --git a/x_include/x_stdio.h b/x_include/x_stdio.h index 648c733..3686f5d 100644 --- a/x_include/x_stdio.h +++ b/x_include/x_stdio.h @@ -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 diff --git a/xify/x_.h b/xify/x_.h index 8a34ede..1d112a3 100644 --- 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 diff --git a/xify/xify.c b/xify/xify.c index 7ebb309..b410925 100644 --- a/xify/xify.c +++ b/xify/xify.c @@ -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 index 0000000..c8161c6 --- /dev/null +++ b/xify/xify.sh @@ -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'