diff -cd csh/Makefile bak3/Makefile
*** csh/Makefile	Tue Jan  5 16:02:46 1993
--- bak3/Makefile	Thu Jan  7 13:29:28 1993
***************
*** 3,40 ****
  # C Shell with process control; VM/UNIX VAX Makefile
  # Bill Joy UC Berkeley; Jim Kulp IIASA, Austria
  #
! # To profile, put -DPROF in DEFS and -pg in CFLAGS, and recompile.
  
! PROG=	csh
! CFLAGS+=-fcombine-regs -fstrength-reduce -DFILEC -DNLS -DSHORT_STRINGS -I.
! SRCS=	alloc.c char.c const.c csh.c dir.c dol.c err.c exec.c exp.c file.c \
! 	func.c glob.c hist.c init.c lex.c misc.c parse.c print.c printf.c \
! 	proc.c sem.c set.c str.c time.c
  
! MAN1=	csh.0
! MLINKS=	csh.1 limit.1 csh.1 alias.1 csh.1 bg.1 csh.1 dirs.1 csh.1 fg.1 \
! 	csh.1 foreach.1 csh.1 history.1 csh.1 jobs.1 csh.1 popd.1 \
! 	csh.1 pushd.1 csh.1 rehash.1 csh.1 repeat.1 csh.1 suspend.1 \
! 	csh.1 stop.1 csh.1 source.1
! CLEANFILES+=err.h const.h
  
! const.h: err.h
  
! err.h: err.c
  	@rm -f $@
  	@echo '/* Do not edit this file, make creates it. */' > $@
  	@echo '#ifndef _h_sh_err' >> $@
  	@echo '#define _h_sh_err' >> $@
! 	egrep 'ERR_' ${.CURDIR}/$*.c | egrep '^#define' >> $@
  	@echo '#endif /* _h_sh_err */' >> $@
  
! const.h: const.c
  	@rm -f $@
  	@echo '/* Do not edit this file, make creates it. */' > $@
! 	${CC} -E ${CFLAGS} ${.CURDIR}/$*.c | egrep 'Char STR' | \
  	    sed -e 's/Char \([a-zA-Z0-9_]*\)\(.*\)/extern Char \1[];/' | \
  	    sort >> $@
  
! .depend alloc.o: const.h err.h
! 
! .include <bsd.prog.mk>
--- 3,41 ----
  # C Shell with process control; VM/UNIX VAX Makefile
  # Bill Joy UC Berkeley; Jim Kulp IIASA, Austria
  #
! # Linux changes by Ken Clark 1/6/93
  
! CFLAGS	= -O3 -s -fstrength-reduce -DFILEC -DNLS \
! 	  -DSHORT_STRINGS -D__USE_BSD -D__USE_BSD_SIGNAL -I.
! # I wanted -fwritable-strings but GCC complained.  Why?  Seems it is not
! # needed anyway.
  
! OBJS	= alloc.o char.o const.o csh.o dir.o dol.o err.o exec.o exp.o file.o \
! 	  func.o glob.o hist.o init.o lex.o misc.o parse.o print.o printf.o \
! 	  proc.o sem.o set.o str.o time.o
  
! CC	= gcc
  
! csh:	$(OBJS)
! 	$(CC) -s -o csh $(OBJS)
! 
! err.h: 
  	@rm -f $@
  	@echo '/* Do not edit this file, make creates it. */' > $@
  	@echo '#ifndef _h_sh_err' >> $@
  	@echo '#define _h_sh_err' >> $@
! 	egrep 'ERR_' $*.c | egrep '^#define' >> $@
  	@echo '#endif /* _h_sh_err */' >> $@
  
! # I have included a const.h and err.h.  It seems my sed is broken
! # with the new shared libs.  Don't know why.
! 
! const.h: 
  	@rm -f $@
  	@echo '/* Do not edit this file, make creates it. */' > $@
! 	${CC} -E ${CFLAGS} $*.c | egrep 'Char STR' | \
  	    sed -e 's/Char \([a-zA-Z0-9_]*\)\(.*\)/extern Char \1[];/' | \
  	    sort >> $@
  
! clean: 
! 	rm -f csh *.o core
diff -cd csh/char.h bak3/char.h
*** csh/char.h	Tue Jan  5 16:02:49 1993
--- bak3/char.h	Wed Jan  6 14:01:13 1993
***************
*** 42,47 ****
--- 42,50 ----
  
  #endif
  
+ #undef _LOW 	/* why the heck did they use underscore?  Are those
+                    variable name supposed to be reserved? */
+ 
  #define	_Q	0x0001		/* '" */
  #define	_Q1	0x0002		/* ` */
  #define	_SP	0x0004		/* space and tab */
diff -cd csh/csh.c bak3/csh.c
*** csh/csh.c	Tue Jan  5 16:02:53 1993
--- bak3/csh.c	Thu Jan  7 11:56:28 1993
***************
*** 110,117 ****
      register char *tcp;
      register int f;
      register char **tempv;
!     struct sigvec osv;
! 
  
      settimes();			/* Immed. estab. timing base */
  
--- 110,117 ----
      register char *tcp;
      register int f;
      register char **tempv;
! /*    struct sigvec osv;*/
!     struct sigaction oact;    /* I guess this is like sigvec? */
  
      settimes();			/* Immed. estab. timing base */
  
***************
*** 128,133 ****
--- 128,134 ----
      environ = short2blk(STR_environ);	/* So that we can free it */
      STR_WORD_CHARS = SAVE(WORD_CHARS);
  
+ 
      HIST = '!';
      HISTSUB = '^';
      word_chars = STR_WORD_CHARS;
***************
*** 229,239 ****
       * only if we are the login shell.
       */
      /* parents interruptibility */
!     (void) sigvec(SIGINT, NULL, &osv);
      parintr = (void (*) ()) osv.sv_handler;
      (void) sigvec(SIGTERM, NULL, &osv);
      parterm = (void (*) ()) osv.sv_handler;
! 
      if (loginsh) {
  	(void) signal(SIGHUP, phup);	/* exit processing on HUP */
  	(void) signal(SIGXCPU, phup);	/* ...and on XCPU */
--- 230,246 ----
       * only if we are the login shell.
       */
      /* parents interruptibility */
! /*    (void) sigvec(SIGINT, NULL, &osv); 
      parintr = (void (*) ()) osv.sv_handler;
      (void) sigvec(SIGTERM, NULL, &osv);
      parterm = (void (*) ()) osv.sv_handler;
! */
! 	
!     sigaction(SIGINT, NULL, &oact);	/* is this is correct? */
!     parintr = oact.sa_handler;
!     sigaction(SIGTERM, NULL, &oact);
!     parterm = oact.sa_handler;
!     
      if (loginsh) {
  	(void) signal(SIGHUP, phup);	/* exit processing on HUP */
  	(void) signal(SIGXCPU, phup);	/* ...and on XCPU */
diff -cd csh/csh.h bak3/csh.h
*** csh/csh.h	Tue Jan  5 16:02:54 1993
--- bak3/csh.h	Wed Jan  6 11:37:37 1993
***************
*** 210,215 ****
--- 210,217 ----
  Char   *gointr;			/* Label for an onintr transfer */
  
  #include <signal.h>
+ typedef void* sig_t;
+ 
  sig_t parintr;			/* Parents interrupt catch */
  sig_t parterm;			/* Parents terminate catch */
  
diff -cd csh/dol.c bak3/dol.c
*** csh/dol.c	Tue Jan  5 16:02:56 1993
--- bak3/dol.c	Wed Jan  6 13:28:41 1993
***************
*** 36,41 ****
--- 36,42 ----
  #endif /* not lint */
  
  #include <sys/types.h>
+ #include <sys/file.h>   /* added for L_SET.  Where should it be? */
  #include <fcntl.h>
  #include <errno.h>
  #include <stdlib.h>
diff -cd csh/func.c bak3/func.c
*** csh/func.c	Tue Jan  5 16:03:04 1993
--- bak3/func.c	Wed Jan  6 19:37:52 1993
***************
*** 35,40 ****
--- 35,42 ----
  static char sccsid[] = "@(#)func.c	5.20 (Berkeley) 6/27/91";
  #endif /* not lint */
  
+ #define notdef	/* what is up with this anyway? See resource.h */
+ 
  #include <sys/types.h>
  #include <sys/stat.h>
  #include <signal.h>
***************
*** 52,57 ****
--- 54,60 ----
  #include "extern.h"
  #include "pathnames.h"
  
+ 
  extern char **environ;
  
  static int zlast = -1;
***************
*** 1108,1114 ****
      Char  **v;
  {
      register float f;
!     double  atof();
      Char   *cp = *v++;
  
      f = atof(short2str(cp));
--- 1111,1117 ----
      Char  **v;
  {
      register float f;
! /*    double  atof();*/
      Char   *cp = *v++;
  
      f = atof(short2str(cp));
diff -cd csh/glob.c bak3/glob.c
*** csh/glob.c	Tue Jan  5 16:03:06 1993
--- bak3/glob.c	Wed Jan  6 13:55:33 1993
***************
*** 354,361 ****
  libglob(vl)
      Char  **vl;
  {
!     int     gflgs = GLOB_QUOTE | GLOB_NOCHECK;
!     glob_t  globv;
      char   *ptr;
  
      globv.gl_offs = 0;
--- 354,361 ----
  libglob(vl)
      Char  **vl;
  {
!     int     gflgs = /*GLOB_QUOTE |*/ GLOB_NOCHECK;
!     glob_t  globv;  /* ^-- why is there not GLOB_QUOTE in the gnu glob? */   
      char   *ptr;
  
      globv.gl_offs = 0;
***************
*** 375,381 ****
  	default:
  	    break;
  	}
! 	if (!nonomatch && (globv.gl_matchc == 0) &&
  	    (globv.gl_flags & GLOB_MAGCHAR)) {
  	    globfree(&globv);
  	    return (NULL);
--- 375,381 ----
  	default:
  	    break;
  	}
! 	if (!nonomatch && (globv.gl_pathc == 0) && /* changed .gl_matchc */
  	    (globv.gl_flags & GLOB_MAGCHAR)) {
  	    globfree(&globv);
  	    return (NULL);
diff -cd csh/lex.c bak3/lex.c
*** csh/lex.c	Tue Jan  5 16:03:09 1993
--- bak3/lex.c	Wed Jan  6 13:57:13 1993
***************
*** 35,40 ****
--- 35,41 ----
  static char sccsid[] = "@(#)lex.c	5.16 (Berkeley) 6/8/91";
  #endif /* not lint */
  
+ #include <sys/file.h>
  #include <sys/types.h>
  #include <sys/ioctl.h>
  #include <termios.h>
diff -cd csh/proc.c bak3/proc.c
*** csh/proc.c	Tue Jan  5 16:03:16 1993
--- bak3/proc.c	Wed Jan  6 14:27:29 1993
***************
*** 84,96 ****
      register struct process *fp;
      register int pid;
      extern int insource;
!     union wait w;
      int     jobflags;
      struct rusage ru;
  
  loop:
      errno = 0;			/* reset, just in case */
!     pid = wait3(&w.w_status,
         (setintr && (intty || insource) ? WNOHANG | WUNTRACED : WNOHANG), &ru);
  
      if (pid <= 0) {
--- 84,97 ----
      register struct process *fp;
      register int pid;
      extern int insource;
! /*    union wait w;	I gather SysV doesn't do it this way */
!     int wait_stat;	/* This it to replace functionality of w */
      int     jobflags;
      struct rusage ru;
  
  loop:
      errno = 0;			/* reset, just in case */
!     pid = wait3(&wait_stat,
         (setintr && (intty || insource) ? WNOHANG | WUNTRACED : WNOHANG), &ru);
  
      if (pid <= 0) {
***************
*** 109,117 ****
      if (pid == atoi(short2str(value(STRchild))))
  	unsetv(STRchild);
      pp->p_flags &= ~(PRUNNING | PSTOPPED | PREPORTED);
!     if (WIFSTOPPED(w)) {
  	pp->p_flags |= PSTOPPED;
! 	pp->p_reason = w.w_stopsig;
      }
      else {
  	if (pp->p_flags & (PTIME | PPTIME) || adrof(STRtime))
--- 110,118 ----
      if (pid == atoi(short2str(value(STRchild))))
  	unsetv(STRchild);
      pp->p_flags &= ~(PRUNNING | PSTOPPED | PREPORTED);
!     if (WIFSTOPPED(wait_stat)) {
  	pp->p_flags |= PSTOPPED;
! 	pp->p_reason = WSTOPSIG(wait_stat);  /*w.w_stopsig;*/
      }
      else {
  	if (pp->p_flags & (PTIME | PPTIME) || adrof(STRtime))
***************
*** 118,134 ****
  	    (void) gettimeofday(&pp->p_etime, NULL);
  
  	pp->p_rusage = ru;
! 	if (WIFSIGNALED(w)) {
! 	    if (w.w_termsig == SIGINT)
  		pp->p_flags |= PINTERRUPTED;
  	    else
  		pp->p_flags |= PSIGNALED;
! 	    if (w.w_coredump)
  		pp->p_flags |= PDUMPED;
! 	    pp->p_reason = w.w_termsig;
  	}
  	else {
! 	    pp->p_reason = w.w_retcode;
  	    if (pp->p_reason != 0)
  		pp->p_flags |= PAEXITED;
  	    else
--- 119,135 ----
  	    (void) gettimeofday(&pp->p_etime, NULL);
  
  	pp->p_rusage = ru;
! 	if (WIFSIGNALED(wait_stat)) {
! 	    if (WTERMSIG(wait_stat) == SIGINT)
  		pp->p_flags |= PINTERRUPTED;
  	    else
  		pp->p_flags |= PSIGNALED;
! 	    if (WCOREDUMP(wait_stat))
  		pp->p_flags |= PDUMPED;
! 	    pp->p_reason = WTERMSIG(wait_stat);
  	}
  	else {
! 	    pp->p_reason = WEXITSTATUS(wait_stat);
  	    if (pp->p_reason != 0)
  		pp->p_flags |= PAEXITED;
  	    else
diff -cd csh/sem.c bak3/sem.c
*** csh/sem.c	Tue Jan  5 16:03:18 1993
--- bak3/sem.c	Wed Jan  6 14:28:57 1993
***************
*** 483,489 ****
  	}
  	else if ((flags & F_NOINTERRUPT) && tpgrp == -1) {
  	    (void) close(0);
! 	    (void) open(_PATH_DEVNULL, O_RDONLY);
  	}
  	else {
  	    (void) close(0);
--- 483,489 ----
  	}
  	else if ((flags & F_NOINTERRUPT) && tpgrp == -1) {
  	    (void) close(0);
! 	    (void) open("/dev/null", O_RDONLY); /*hard coded.  no paths.h yet*/
  	}
  	else {
  	    (void) close(0);
