Return to BSD News archive
Newsgroups: comp.bugs.2bsd Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!hobyah.cc.uq.oz.au!bunyip.cc.uq.oz.au!munnari.OZ.AU!news.ecn.uoknor.edu!qns3.qns.com!imci4!newsfeed.internetmci.com!news.kei.com!nntp.coast.net!frankensun.altair.com!wlbr!moe!sms From: sms@moe.2bsd.com (Steven M. Schultz) Subject: sys_errlist[] wastes 2kb of D-space [+fix] (#312 4 of 4) Organization: GTE Government Systems, Westlake Village Message-ID: <Dp4GIx.GAz@moe.2bsd.com> Date: Sun, 31 Mar 1996 07:52:09 GMT Lines: 1146 Subject: sys_errlist[] wastes 2kb of D-space [+fix] (#312 4 of 4) Index: lib/libc/gen/errlst.c+many,many_more 2.11BSD Description: The array of system error message strings occupies approximately 2kb of Data space in any program which calls perror(), strerror() or explicitly references sys_errlist[] or sys_nerr. Since sys_errlist is initialized data it also occupies ~4 sectors of disk space in each program's executable disk image. Repeat-By: Observation. Or by compiling these test programs and using size(1): extern char *sys_errlist[]; main() { char *cp; cp = sys_errlist[0]; exit(0); } cc x.c size a.out text data bss dec hex 362 2042 4 2408 968 main() { perror("foo"); exit(0); } cc y.c size a.out text data bss dec hex 3310 2298 4 5668 1624 In both cases the 'data' segment is 100% sys_errlist[]'s contribution. After applying the updates in this kit the second program's size is: text data bss dec hex 1008 60 68 1136 470 Fix: This is #312 (part 4 of 4). This is the third and final part of the three patch files in the update kit. Refer to the instructions in #309. -------------------------------cut here---------------------------- *** /usr/src/local/afio/afio.c.old Thu Sep 21 10:16:00 1989 --- /usr/src/local/afio/afio.c Thu Mar 21 21:38:59 1996 *************** *** 24,30 **** * o Define CTC3B2 to support AT&T 3B2 streaming cartridge tape. */ ! static char *ident = "$Header: afio.c,v 1.68 86/12/15 13:07:11 mdb Exp $"; #include <stdio.h> #include <errno.h> --- 24,30 ---- * o Define CTC3B2 to support AT&T 3B2 streaming cartridge tape. */ ! static char *ident = "$Header: afio.c,v 1.68.1 96/3/21 13:07:11 mdb Exp $"; #include <stdio.h> #include <errno.h> *************** *** 34,39 **** --- 34,40 ---- #include <sys/stat.h> #include <pwd.h> #include <grp.h> + #include <string.h> #ifndef major # include <sys/sysmacros.h> *************** *** 333,339 **** Link *linkfrom(); void linkleft(); Link *linkto(); - void memcpy(); char *memget(); char *memstr(); int mkdir(); --- 334,339 ---- *************** *** 383,390 **** * External variables. */ extern int errno; /* System error code */ - extern char *sys_errlist[]; /* System error messages */ - extern int sys_nerr; /* Number of sys_errlist entries */ /* * Static variables. --- 383,388 ---- *************** *** 2511,2525 **** * * Return pointer to appropriate system error message. */ ! STATIC char * syserr() { - static char msg[40]; ! if (errno > 0 && errno < sys_nerr) ! return (sys_errlist[errno]); ! VOID sprintf(msg, "Unknown error (errno %d)", errno); ! return (msg); } /* --- 2509,2519 ---- * * Return pointer to appropriate system error message. */ ! char * syserr() { ! return (strerror(errno)); } /* *** /usr/src/local/popper/pop_dropcopy.c.old Wed Jun 24 16:14:59 1992 --- /usr/src/local/popper/pop_dropcopy.c Thu Mar 21 21:59:26 1996 *************** *** 4,12 **** * specifies the terms and conditions for redistribution. */ ! #ifndef lint static char copyright[] = "Copyright (c) 1990 Regents of the University of California.\nAll rights reserved.\n"; ! static char SccsId[] = "@(#)@(#)pop_dropcopy.c 2.6 2.6 4/3/91"; #endif not lint #include <errno.h> --- 4,12 ---- * specifies the terms and conditions for redistribution. */ ! #if !defined(lint) && defined(DOSCCS) static char copyright[] = "Copyright (c) 1990 Regents of the University of California.\nAll rights reserved.\n"; ! static char SccsId[] = "@(#)@(#)pop_dropcopy.c 2.6.1 (2.11BSD) 1996/3/21"; #endif not lint #include <errno.h> *************** *** 18,27 **** #include <pwd.h> #include "popper.h" - extern int errno; - extern int sys_nerr; - extern char *sys_errlist[]; - /* * dropcopy: Make a temporary copy of the user's mail drop and * save a stream pointer for it. --- 18,23 ---- *************** *** 62,68 **** if ( (tf=fopen(template,"w+")) == NULL ) { /* failure, bail out */ pop_log(p,POP_PRIORITY, "Unable to create temporary temporary maildrop '%s': %s",template, ! (errno < sys_nerr) ? sys_errlist[errno] : "") ; return pop_msg(p,POP_FAILURE, "System error, can't create temporary file."); } --- 58,64 ---- if ( (tf=fopen(template,"w+")) == NULL ) { /* failure, bail out */ pop_log(p,POP_PRIORITY, "Unable to create temporary temporary maildrop '%s': %s",template, ! strerror(errno)); return pop_msg(p,POP_FAILURE, "System error, can't create temporary file."); } *************** *** 92,98 **** if ((dfd = open(p->temp_drop,O_RDWR|O_APPEND|O_CREAT,0600)) == -1){ pop_log(p,POP_PRIORITY, "Unable to open temporary maildrop '%s': %s",p->temp_drop, ! (errno < sys_nerr) ? sys_errlist[errno] : "") ; return pop_msg(p,POP_FAILURE, "System error, can't open temporary file, do you own it?"); } --- 88,94 ---- if ((dfd = open(p->temp_drop,O_RDWR|O_APPEND|O_CREAT,0600)) == -1){ pop_log(p,POP_PRIORITY, "Unable to open temporary maildrop '%s': %s",p->temp_drop, ! strerror(errno)); return pop_msg(p,POP_FAILURE, "System error, can't open temporary file, do you own it?"); } *************** *** 106,112 **** /* NOTREACHED */ default: return pop_msg(p,POP_FAILURE,"flock: '%s': %s", p->temp_drop, ! (errno < sys_nerr) ? sys_errlist[errno] : ""); /* NOTREACHED */ } --- 102,108 ---- /* NOTREACHED */ default: return pop_msg(p,POP_FAILURE,"flock: '%s': %s", p->temp_drop, ! strerror(errno)); /* NOTREACHED */ } *************** *** 120,126 **** if (flock (mfd,LOCK_EX) == -1) { (void)close(mfd) ; return pop_msg(p,POP_FAILURE, "flock: '%s': %s", p->temp_drop, ! (errno < sys_nerr) ? sys_errlist[errno] : ""); } /* Copy the actual mail drop into the temporary mail drop */ --- 116,122 ---- if (flock (mfd,LOCK_EX) == -1) { (void)close(mfd) ; return pop_msg(p,POP_FAILURE, "flock: '%s': %s", p->temp_drop, ! strerror(errno)); } /* Copy the actual mail drop into the temporary mail drop */ *** /usr/src/local/popper/pop_dropinfo.c.old Wed Jun 24 16:17:15 1992 --- /usr/src/local/popper/pop_dropinfo.c Thu Mar 21 22:00:12 1996 *************** *** 4,12 **** * specifies the terms and conditions for redistribution. */ ! #ifndef lint static char copyright[] = "Copyright (c) 1990 Regents of the University of California.\nAll rights reserved.\n"; ! static char SccsId[] = "@(#)@(#)pop_dropinfo.c 2.1 2.1 3/18/91"; #endif not lint #include <errno.h> --- 4,12 ---- * specifies the terms and conditions for redistribution. */ ! #if !defined(lint) && defined(DOSCCS) static char copyright[] = "Copyright (c) 1990 Regents of the University of California.\nAll rights reserved.\n"; ! static char SccsId[] = "@(#)@(#)pop_dropinfo.c 2.1.1 (2.11BSD) 1996/3/21"; #endif not lint #include <errno.h> *************** *** 16,25 **** #include <sys/stat.h> #include <sys/file.h> #include "popper.h" - - extern int errno; - extern int sys_nerr; - extern char *sys_errlist[]; /* * dropinfo: Extract information about the POP maildrop and store --- 16,21 ---- *** /usr/src/local/popper/pop_updt.c.old Wed Jun 24 16:19:16 1992 --- /usr/src/local/popper/pop_updt.c Thu Mar 21 22:04:29 1996 *************** *** 4,12 **** * specifies the terms and conditions for redistribution. */ ! #ifndef lint static char copyright[] = "Copyright (c) 1990 Regents of the University of California.\nAll rights reserved.\n"; ! static char SccsId[] = "@(#)@(#)pop_updt.c 2.3 2.3 3/20/91"; #endif not lint #include <errno.h> --- 4,12 ---- * specifies the terms and conditions for redistribution. */ ! #if !defined(lint) && defined(lint) static char copyright[] = "Copyright (c) 1990 Regents of the University of California.\nAll rights reserved.\n"; ! static char SccsId[] = "@(#)@(#)pop_updt.c 2.3.1 (2.11BSD) 1996/3/21"; #endif not lint #include <errno.h> *************** *** 17,24 **** #include <sys/file.h> #include "popper.h" - extern int errno; - static char standard_error[] = "Error error updating primary drop. Mailbox unchanged"; --- 17,22 ---- *************** *** 75,81 **** if ( flock(mfd,LOCK_EX) == -1 ) { (void)fclose(md) ; return pop_msg(p,POP_FAILURE, "flock: '%s': %s", p->temp_drop, ! (errno < sys_nerr) ? sys_errlist[errno] : ""); } /* Go to the right places */ --- 73,79 ---- if ( flock(mfd,LOCK_EX) == -1 ) { (void)fclose(md) ; return pop_msg(p,POP_FAILURE, "flock: '%s': %s", p->temp_drop, ! strerror(errno)); } /* Go to the right places */ *** /usr/src/local/popper/popper.h.old Sat Jun 11 17:44:02 1994 --- /usr/src/local/popper/popper.h Thu Mar 21 22:00:55 1996 *************** *** 4,10 **** * specifies the terms and conditions for redistribution. * * static char copyright[] = "Copyright (c) 1990 Regents of the University of California.\nAll rights reserved.\n"; ! * static char SccsId[] = "@(#)@(#)popper.h 2.2.1 (2.11BSD) 6/11/94"; * */ --- 4,10 ---- * specifies the terms and conditions for redistribution. * * static char copyright[] = "Copyright (c) 1990 Regents of the University of California.\nAll rights reserved.\n"; ! * static char SccsId[] = "@(#)@(#)popper.h 2.2.2 (2.11BSD) 1996/3/21"; * */ *************** *** 56,63 **** #define POP_TERMINATE '.' extern int errno; - extern int sys_nerr; - extern char * sys_errlist[]; extern char * sys_siglist[]; #define pop_command pop_parm[0] /* POP command is first token */ --- 56,61 ---- *** /usr/src/local/qterm/options.c.old Tue Nov 21 20:08:25 1995 --- /usr/src/local/qterm/options.c Sat Mar 23 00:39:26 1996 *************** *** 4,11 **** * profit and the author is credited appropriately. */ ! #ifndef lint ! static char *RCSid = "$Header: /am/sol/src/common/usc/lib/libgen/RCS/options.c,v 1.13 90/12/15 18:13:28 mcooper Exp $"; #endif /* --- 4,11 ---- * profit and the author is credited appropriately. */ ! #if !defined(lint) && defined(DOSCCS) ! static char *RCSid = "$Header: options.c,v 1.13.1 96/3/23 18:13:28 sms Exp $"; #endif /* *************** *** 427,433 **** if (docopy) { if ((p = (char *) malloc((unsigned)strlen(value)+1)) == NULL) { ! UserError("Cannot malloc memory: %s", SYSERR); return(FALSE); } (void) strcpy(p, value); --- 427,433 ---- if (docopy) { if ((p = (char *) malloc((unsigned)strlen(value)+1)) == NULL) { ! UserError("Cannot malloc memory."); return(FALSE); } (void) strcpy(p, value); *** /usr/src/local/qterm/options.h.old Tue Nov 21 20:08:28 1995 --- /usr/src/local/qterm/options.h Sat Mar 23 00:37:22 1996 *************** *** 5,11 **** */ /* ! * $Header: /am/sol/src/common/usc/lib/libgen/RCS/options.h,v 1.7 90/12/15 18:13:30 mcooper Exp $ * * $Log: options.h,v $ * Revision 1.7 90/12/15 18:13:30 mcooper --- 5,11 ---- */ /* ! * $Header: RCS/options.h,v 1.7.1 96/3/23 18:13:30 sms Exp $ * * $Log: options.h,v $ * Revision 1.7 90/12/15 18:13:30 mcooper *************** *** 40,48 **** #define HELPSTR "-help" #define __ (caddr_t) - #ifndef SYSERR - #define SYSERR sys_errlist[errno] - #endif #ifndef TRUE #define TRUE 1 #endif --- 40,45 ---- *** /usr/src/new/Makefile.old Mon Jan 25 08:58:54 1993 --- /usr/src/new/Makefile Thu Mar 21 21:20:55 1996 *************** *** 16,24 **** # Special purpose software that requires custom installation, # or may not be needed by all sites # ! OPTDIR= crash oldassn kermit5.188 news ntp pathalias rcs rn notes nntp ! SUBDIR= ansi bm checkobj crash jove kermit5.188 l11 la m11 news nmcoll nntp \ notes ntp oldassn patch pathalias rcs rn shar shortc tcsh \ traceroute vmsbackup --- 16,24 ---- # Special purpose software that requires custom installation, # or may not be needed by all sites # ! OPTDIR= crash oldassn kermit5.188 ntp pathalias rcs rn notes nntp ! SUBDIR= ansi bm checkobj crash jove kermit5.188 l11 la m11 nmcoll nntp \ notes ntp oldassn patch pathalias rcs rn shar shortc tcsh \ traceroute vmsbackup *** /usr/src/new/kermit5.188/ckcfn3.c.old Mon Nov 23 21:04:50 1992 --- /usr/src/new/kermit5.188/ckcfn3.c Sat Mar 23 00:29:25 1996 *************** *** 17,22 **** --- 17,23 ---- #include "ckcasc.h" #include "ckcker.h" #include "ckcxla.h" + #include <errno.h> extern int unkcs, wmax, wcur, discard, bctu, bctl, local, fdispla; extern CHAR *data; *************** *** 1226,1239 **** } else { /* Did not open file OK. */ #ifdef ATTSV ! extern char *sys_errlist[]; ! extern int errno; ! screen(SCR_EM,0,0l,sys_errlist[errno]); #else #ifdef BSD4 ! extern char *sys_errlist[]; ! extern int errno; ! screen(SCR_EM,0,0l,sys_errlist[errno]); #else screen(SCR_EM,0,0l,"Can't open output file"); #endif /* BSD4 */ --- 1227,1236 ---- } else { /* Did not open file OK. */ #ifdef ATTSV ! screen(SCR_EM,0,0l,strerror(errno)); #else #ifdef BSD4 ! screen(SCR_EM,0,0l,strerror(errno)); #else screen(SCR_EM,0,0l,"Can't open output file"); #endif /* BSD4 */ *** /usr/src/new/nntp/server/fakesyslog.c.old Sat Feb 6 16:34:54 1988 --- /usr/src/new/nntp/server/fakesyslog.c Thu Mar 21 22:35:50 1996 *************** *** 1,5 **** ! #ifndef lint ! static char *sccsid = "@(#)fakesyslog.c 1.3 (Berkeley) 2/6/88"; #endif /* --- 1,5 ---- ! #if !defined(lint) && defined(DOSCCS) ! static char *sccsid = "@(#)fakesyslog.c 1.3.1 (2.11BSD) 1996/3/21"; #endif /* *************** *** 12,29 **** */ #include <stdio.h> #include "../common/conf.h" #ifdef FAKESYSLOG - extern int errno; - extern int sys_nerr; - extern char *sys_errlist[]; - static FILE *logfp; ! char *strcpy(), *strcat(), *ctime(); openlog() { --- 12,27 ---- */ #include <stdio.h> + #include <string.h> + #include <errno.h> #include "../common/conf.h" #ifdef FAKESYSLOG static FILE *logfp; ! char *ctime(); openlog() { *************** *** 60,71 **** for (cp = msg; *cp; cp++) { if (*cp == '%' && cp[1] == 'm') { *bp = '\0'; ! if (errno >= sys_nerr || errno < 0) { ! char work[32]; ! sprintf(work, "unknown error #%d", errno); ! (void) strcat(bp, work); ! } else ! (void) strcat(bp, sys_errlist[errno]); bp = buf + strlen(buf); cp++; } else { --- 58,64 ---- for (cp = msg; *cp; cp++) { if (*cp == '%' && cp[1] == 'm') { *bp = '\0'; ! (void) strcat(bp, strerror(errno)); bp = buf + strlen(buf); cp++; } else { *** /usr/src/new/nntp/xmit/nntpxmit.c.old Tue Jan 12 00:37:55 1988 --- /usr/src/new/nntp/xmit/nntpxmit.c Thu Mar 21 22:37:36 1996 *************** *** 516,530 **** errmsg(code) int code; { ! extern int sys_nerr; ! extern char *sys_errlist[]; ! static char ebuf[6+5+1]; ! ! if (code > sys_nerr || code < 0) { ! (void) sprintf(ebuf, "Error %d", code); ! return ebuf; ! } else ! return sys_errlist[code]; } /* --- 516,522 ---- errmsg(code) int code; { ! return(strerror(code)); } /* *** /usr/src/new/nntp/xmit/shlock.c.old Thu Dec 17 17:08:20 1987 --- /usr/src/new/nntp/xmit/shlock.c Thu Mar 21 22:38:08 1996 *************** *** 99,108 **** errmsg(n) register int n; { ! extern int sys_nerr; ! extern char *sys_errlist[]; ! ! return((n >= 0 && n < sys_nerr) ? sys_errlist[n] : "unknown error"); } mklock(file, pid) --- 99,105 ---- errmsg(n) register int n; { ! return(strerror(n)); } mklock(file, pid) *** /usr/src/new/notes/src/Makefile.user.old Mon Jul 17 21:32:39 1989 --- /usr/src/new/notes/src/Makefile.user Thu Mar 21 23:16:21 1996 *************** *** 1,9 **** ! MAIN = access.o acssort.o adnote.o adresp.o asearch.o check.o compress.o \ control.o cursor.o delete.o dropt.o dsply.o gdate.o gname.o \ gtext.o gtime.o help.o index.o limindx.o lrsp.o mailit.o MAIN1 = misc.o miscio.o next.o note.o pagein.o pageout.o pattern.o \ permit.o perms.o preptxt.o prtind.o readem.o ! MAIN2 = savtxt.o startup.o talkto.o times.o tsearch.o \ expand.o datein.o getdate.o ftime.o pagemove.o resp.o recsio.o CHECKNOTES = check.o cursor.o gname.o gtime.o lrsp.o misc.o miscio.o \ next.o pattern.o perms.o recsio.o startup.o times.o expand.o --- 1,9 ---- ! MAIN = acssort.o adnote.o adresp.o asearch.o check.o compress.o \ control.o cursor.o delete.o dropt.o dsply.o gdate.o gname.o \ gtext.o gtime.o help.o index.o limindx.o lrsp.o mailit.o MAIN1 = misc.o miscio.o next.o note.o pagein.o pageout.o pattern.o \ permit.o perms.o preptxt.o prtind.o readem.o ! MAIN2 = access.o savtxt.o startup.o talkto.o times.o tsearch.o \ expand.o datein.o getdate.o ftime.o pagemove.o resp.o recsio.o CHECKNOTES = check.o cursor.o gname.o gtime.o lrsp.o misc.o miscio.o \ next.o pattern.o perms.o recsio.o startup.o times.o expand.o *** /usr/src/new/notes/src/gname.c.old Tue Mar 19 17:45:04 1985 --- /usr/src/new/notes/src/gname.c Fri Mar 22 00:00:03 1996 *************** *** 1,5 **** --- 1,6 ---- #include "parms.h" #include "structs.h" + #include <pwd.h> #ifdef RCSIDENT static char rcsid[] = "$Header: gname.c,v 1.7.0.1 85/03/17 20:55:37 notes Rel $"; *************** *** 13,31 **** getname (who_me, anon) /* anon=true for anonymous */ struct auth_f *who_me; { - static char name[PASSWDLEN]; /* must contain the /etc/passwd entry */ register count; register char *s, *d; static int gotname = 0; /* whether we have done a getpw */ ! static int gotstat = 0; /* status getpw returned */ if (gotname == 0 && anon == 0) /* grab name if we will require it */ { ! gotstat = getpw (globuid, name); /* grab it */ gotname = 1; /* set flag saying we have it */ } ! if (gotstat || anon) { s = "Anonymous:"; who_me -> aid = Anonuid; --- 14,31 ---- getname (who_me, anon) /* anon=true for anonymous */ struct auth_f *who_me; { register count; register char *s, *d; static int gotname = 0; /* whether we have done a getpw */ ! static struct passwd *gotstat = 0; if (gotname == 0 && anon == 0) /* grab name if we will require it */ { ! gotstat = getpwuid(globuid); /* grab it */ gotname = 1; /* set flag saying we have it */ } ! if (!gotstat || anon) { s = "Anonymous:"; who_me -> aid = Anonuid; *************** *** 32,43 **** } else { ! s = name; who_me -> aid = globuid; } d = who_me -> aname; /* copy his name */ count = NAMESZ; ! while (((*d++ = *s++) != ':') && --count); *--d = '\0'; s = Authsystem; /* copy his system */ d = who_me -> asystem; --- 32,43 ---- } else { ! s = gotstat->pw_name; who_me -> aid = globuid; } d = who_me -> aname; /* copy his name */ count = NAMESZ; ! while (((*d++ = *s++) != '\0') && --count); *--d = '\0'; s = Authsystem; /* copy his system */ d = who_me -> asystem; *** /usr/src/new/notes/src/misc.c.old Thu Nov 10 19:50:09 1988 --- /usr/src/new/notes/src/misc.c Thu Mar 21 22:41:58 1996 *************** *** 8,14 **** #endif SIGCHLD #ifdef RCSIDENT ! static char rcsid[] = "$Header: /usr/local/src/usenet/notes/src/RCS/misc.c,v 1.9 88/11/10 21:49:42 paul Exp $"; #endif RCSIDENT #define LOCKTRY 10 /* number of shots at grabbing */ --- 8,14 ---- #endif SIGCHLD #ifdef RCSIDENT ! static char rcsid[] = "$Header: src/usenet/notes/src/RCS/misc.c,v 1.9.1 96/3/21 21:49:42 paul Exp $"; #endif RCSIDENT #define LOCKTRY 10 /* number of shots at grabbing */ *************** *** 229,236 **** sprintf (pbuf2, "%s: aborted", Invokedas); sprintf (pbuf, "Program:\t%s\nMessage:\t%s\n\nerrno:\t\t%d (%s)\n", ! Invokedas, p, errno, ! errno >= sys_nerr ? "Unknown error code" : sys_errlist[errno]); #ifdef DUMPCORE if ((tail = rindex (Invokedas, '/')) == NULL) /* pathname? */ tail = Invokedas; /* simple invocation */ --- 229,235 ---- sprintf (pbuf2, "%s: aborted", Invokedas); sprintf (pbuf, "Program:\t%s\nMessage:\t%s\n\nerrno:\t\t%d (%s)\n", ! Invokedas, p, errno, strerror(errno)); #ifdef DUMPCORE if ((tail = rindex (Invokedas, '/')) == NULL) /* pathname? */ tail = Invokedas; /* simple invocation */ *************** *** 290,296 **** char tbuf[256]; /* title */ sprintf (pbuf, "lock %c failed for %s,\nerrno = %d (%s)\nProgram = %s\n", ! c, io -> fullname, holderr, sys_errlist[holderr], Invokedas); sprintf (tbuf, "%s: locked (%c)", io -> nf, c); nfcomment (NFMAINT, pbuf, tbuf, 0, 0); --- 289,295 ---- char tbuf[256]; /* title */ sprintf (pbuf, "lock %c failed for %s,\nerrno = %d (%s)\nProgram = %s\n", ! c, io -> fullname, holderr, strerror(holderr), Invokedas); sprintf (tbuf, "%s: locked (%c)", io -> nf, c); nfcomment (NFMAINT, pbuf, tbuf, 0, 0); *************** *** 362,368 **** char pbuf2[256]; sprintf (pbuf, "glock %c failed for %s, errno = %d (%s)\nProgram = %s\n", ! c, io -> fullname, holderr, sys_errlist[holderr], Invokedas); sprintf (pbuf2, "Frozen Global Lock (%c)", c); nfcomment (NFMAINT, pbuf, pbuf2, 0, 0); --- 361,367 ---- char pbuf2[256]; sprintf (pbuf, "glock %c failed for %s, errno = %d (%s)\nProgram = %s\n", ! c, io -> fullname, holderr, strerror(holderr), Invokedas); sprintf (pbuf2, "Frozen Global Lock (%c)", c); nfcomment (NFMAINT, pbuf, pbuf2, 0, 0); *** /usr/src/new/notes/src/miscio.c.old Sat Jul 8 13:09:23 1989 --- /usr/src/new/notes/src/miscio.c Thu Mar 21 22:51:51 1996 *************** *** 2,8 **** #include "structs.h" #ifdef RCSIDENT ! static char rcsid[] = "$Header: miscio.c,v 1.7.0.3 86/02/11 23:06:01 notes Rel $"; #endif RCSIDENT --- 2,8 ---- #include "structs.h" #ifdef RCSIDENT ! static char rcsid[] = "$Header: miscio.c,v 1.7.0.4 96/3/21 23:06:01 notes Rel $"; #endif RCSIDENT *************** *** 126,141 **** exit (1); } #endif defined(USG) - - #if defined(BSD4x) || defined(BSD2x) - localbits = LTILDE; /* zap tildes (hazeltines) */ - if (ioctl (0, TIOCSETN, &tty) < 0 || - ioctl (0, TIOCLBIC, &localbits) < 0) - { - fprintf (stderr, "%s: Unable to set tty state\n", Invokedas); - exit (1); - } - #endif modeset = 1; cmstart (); /* so can cursor address reliably */ --- 126,131 ---- *** /usr/src/new/notes/src/startup.c.old Sat Jul 8 16:19:23 1989 --- /usr/src/new/notes/src/startup.c Thu Mar 21 23:02:13 1996 *************** *** 1,14 **** #include "parms.h" #include "structs.h" #include <pwd.h> - #ifdef pdp11 - #include <short_names.h> - #endif #ifdef RCSIDENT ! static char rcsid[] = "$Header: startup.c,v 1.7.0.3 85/03/18 20:56:44 notes Rel $"; #endif RCSIDENT ! static char *Bigversion = "Notesfiles: $Revision: 1.7.0.3 $"; /* * this file contains code and declarations that are common to --- 1,11 ---- #include "parms.h" #include "structs.h" #include <pwd.h> #ifdef RCSIDENT ! static char rcsid[] = "$Header: startup.c,v 1.7.0.4 96/3/21 20:56:44 notes Rel $"; #endif RCSIDENT ! static char *Bigversion = "Notesfiles: $Revision: 1.7.0.4 $"; /* * this file contains code and declarations that are common to *** /usr/src/new/notes/src/structs.h.old Sat Jul 8 19:05:02 1989 --- /usr/src/new/notes/src/structs.h Thu Mar 21 22:43:31 1996 *************** *** 2,14 **** #include <sys/param.h> #if defined(RCSIDENT) && defined(MAINLINE) ! static char zzstructs[] = "$Header: /usr/local/src/usenet/notes/src/RCS/structs.h,v 1.9 88/11/10 21:48:27 paul Exp $"; #endif defined(RCSIDENT) && defined(MAINLINE) - #ifdef pdp11 - #define gettime(a) _gettime(a) /* conflicts with gettimeofday() */ - #endif - /* * structure definitions for the notesfile program. * --- 2,10 ---- #include <sys/param.h> #if defined(RCSIDENT) && defined(MAINLINE) ! static char zzstructs[] = "$Header: src/usenet/notes/src/RCS/structs.h,v 1.9.1 96/3/21 21:48:27 paul Exp $"; #endif defined(RCSIDENT) && defined(MAINLINE) /* * structure definitions for the notesfile program. * *************** *** 406,413 **** */ extern int errno; /* syscall errors */ - extern char *sys_errlist[]; /* errno messages */ - extern int sys_nerr; /* and how many */ #if BSD < 43 extern char *sprintf (); /* satisfy lint */ #endif --- 402,407 ---- *** /usr/src/new/tcsh/sh.h.old Wed Aug 21 10:53:50 1991 --- /usr/src/new/tcsh/sh.h Thu Mar 21 23:20:19 1996 *************** *** 1,4 **** ! /* $Header: /home/hyperion/mu/christos/src/sys/tcsh-6.00/RCS/sh.h,v 3.1 1991/07/05 19:07:20 christos Exp $ */ /* * sh.h: Catch it all globals and includes file! */ --- 1,4 ---- ! /* $Header: src/sys/tcsh-6.00/RCS/sh.h,v 3.1.1 1996/03/21 19:07:20 christos Exp $ */ /* * sh.h: Catch it all globals and includes file! */ *************** *** 699,713 **** Char HIST; /* history invocation character */ Char HISTSUB; /* auto-substitute character */ - - /* - * To print system call errors... - */ - extern char *sys_errlist[]; - extern int errno, sys_nerr; - - #define strerror(e) ((e) < sys_nerr && (e) >= 0 ? sys_errlist[(e)] :\ - "Unknown Error") /* * strings.h: --- 699,704 ---- *** /usr/src/old/vpr/vpd.c.old Thu Nov 18 20:27:45 1982 --- /usr/src/old/vpr/vpd.c Fri Mar 22 17:27:32 1996 *************** *** 1,10 **** #define CONSOLE "/dev/console" #define dprcons if (debug) prcons /* ! * vpd.c updated 11/18/82 * Varian or Versatec printer daemon */ ! char vpdSCCSid[] = "@(#)vpd.c 1.4\t11/18/82"; #include <stdio.h> #include <sys/param.h> --- 1,10 ---- #define CONSOLE "/dev/console" #define dprcons if (debug) prcons /* ! * vpd.c updated 1996/3/21 * Varian or Versatec printer daemon */ ! char vpdSCCSid[] = "@(#)vpd.c 1.4.1 1996/3/21"; #include <stdio.h> #include <sys/param.h> *************** *** 126,133 **** if (open(DEVICE, 1) == 3) break; if (errno != EIO) { ! extern char *sys_errlist[]; ! prcons("%s: %s: %s\n", NAME, DEVICE, sys_errlist[errno]); unlink("lock"); exit(1); } --- 126,132 ---- if (open(DEVICE, 1) == 3) break; if (errno != EIO) { ! prcons("%s: %s: %s\n", NAME, DEVICE, strerror(errno)); unlink("lock"); exit(1); } *** /usr/ingres/source/monitor/quit.c.old Sat Feb 4 12:55:54 1995 --- /usr/ingres/source/monitor/quit.c Sat Mar 23 00:24:41 1996 *************** *** 1,5 **** ! # include <stdio.h> # include "../ingres.h" # include "../aux.h" # include "../pipes.h" --- 1,11 ---- ! /* ! * @(#) quit.c 1.1 (2.11BSD) 1996/3/22 ! */ + #include <stdio.h> + #include <signal.h> + #include <string.h> + # include "../ingres.h" # include "../aux.h" # include "../pipes.h" *************** *** 19,43 **** ** 3/2/79 (eric) -- Changed to close Trapfile. */ ! /* list of fatal signals */ ! char *Siglist[] = ! { ! "Signal 0", ! "hangup", ! "interrupt", ! "quit", ! "illegal instruction", ! "trace trap", ! "IOT", ! "EMT", ! "floating point exception", ! "killed", ! "bus error", ! "segmentation violation", ! "bad system call", ! "broken pipe", ! "alarm", ! }; quit() { --- 25,31 ---- ** 3/2/79 (eric) -- Changed to close Trapfile. */ ! extern char *sys_siglist[]; quit() { *************** *** 49,57 **** int pidlist[50]; extern int (*Exitfn)(); extern exit(); - extern int sys_nerr; - extern char *sys_errlist[]; char indexx[0400]; # ifdef xMTR1 if (tTf(1, -1)) --- 37,44 ---- int pidlist[50]; extern int (*Exitfn)(); extern exit(); char indexx[0400]; + char *cp; # ifdef xMTR1 if (tTf(1, -1)) *************** *** 79,86 **** err = 0; /* clear out the system error index table */ ! for (ndx = 0; ndx < 0400; ndx++) ! indexx[ndx] = 0; /* wait for all process to terminate */ while ((ndx = wait(&status)) != -1) --- 66,72 ---- err = 0; /* clear out the system error index table */ ! bzero(indexx, sizeof (indexx)); /* wait for all process to terminate */ while ((ndx = wait(&status)) != -1) *************** *** 95,104 **** { printf("%d: ", ndx); ndx = status & 0177; ! if (ndx > sizeof Siglist / sizeof Siglist[0]) printf("Abnormal Termination %d", ndx); else ! printf("%s", Siglist[ndx]); if ((status & 0200) != 0) printf(" -- Core Dumped"); printf("\n"); --- 81,90 ---- { printf("%d: ", ndx); ndx = status & 0177; ! if (ndx > NSIG) printf("Abnormal Termination %d", ndx); else ! printf("%s", sys_siglist[ndx]); if ((status & 0200) != 0) printf(" -- Core Dumped"); printf("\n"); *************** *** 124,139 **** { if (indexx[ndx] == 0) continue; ! if (ndx <= sys_nerr) ! { ! if (err == 0) ! printf("\nUNIX error dictionary:\n"); ! printf("%3d: %s\n", ndx, sys_errlist[ndx]); ! } if (err == 0) err = ndx; } ! if (err > 0 && err <= sys_nerr) printf("\n"); /* PRINT LOGOUT CUE ? */ --- 110,125 ---- { if (indexx[ndx] == 0) continue; ! cp = syserrlst(ndx); ! if (!cp) ! break; if (err == 0) + printf("\nUNIX error dictionary:\n"); + printf("%3d: %s\n", ndx, cp); + if (err == 0) err = ndx; } ! if (err) printf("\n"); /* PRINT LOGOUT CUE ? */ *** /usr/ingres/source/support/ingres.c.old Sun Feb 12 08:25:36 1995 --- /usr/ingres/source/support/ingres.c Sat Mar 23 00:26:44 1996 *************** *** 1,3 **** --- 1,8 ---- + /* + * @(#) ingres.c 1.1 (2.11BSD) 1996/3/22 + */ + + #include <errno.h> # include "../ingres.h" # include "../aux.h" # include "../access.h" *************** *** 187,197 **** int No_exec; /* if set, don't execute */ char *User_ovrd; /* override usercode from -u flag */ - /* system error messages, etc. */ - extern int sys_nerr; - extern char *sys_errlist[]; - extern int errno; - main(argc, argv) int argc; char **argv; --- 192,197 ---- *************** *** 342,348 **** /* open and read the process table */ if ((fd = open(proctab, 0)) < 0) { ! printf("Proctab %s: %s\n", proctab, sys_errlist[errno]); goto usage; } --- 342,348 ---- /* open and read the process table */ if ((fd = open(proctab, 0)) < 0) { ! printf("Proctab %s: %s\n", proctab, strerror(errno)); goto usage; }