tim@banyan.UUCP (Tim Henrion@Eng@Banyan) (06/14/89)
There are a couple of problems with 'bash' on a 386 running SYSTEM V. In jobs.h there is some 386 specific code to evaluate the return value from the wait() system call (in lieu of SYSTEM V.3.2 having a <sys/wait.h> include file). Unfortunately this 386 specific code does not conform the the proper 386 byte ordering when checking the wait() return value and does not check the 'core dumped' flag correctly. The effect of these bugs is that whenever you run a program from 'bash' and it exits you get all kinds of bogus "Signal XX (core dumped)" error messages. I have fixed the byte ordering for the wait() return value and properly defined the checking of the 'core dumped' as per the AT&T *Unix SYSTEM V/386 Programmer's Reference Manual*. ------------------------------------------------------------ *** jobs.h Sun May 21 12:04:27 1989 --- new-jobs.h Wed Jun 14 08:57:23 1989 *************** *** 6,18 **** #ifdef i386 ! union wait { struct { char high; char low; } bytes; short word; }; #define WSTOPPED 0177 #define w_status word #define w_termsig bytes.low #define w_stopsig bytes.high #define w_retcode bytes.high ! #define w_coredump w_termsig & 0x7f #define WIFEXITED(wstat) ((wstat).bytes.low == 0) #define WIFSTOPPED(wstat) ((wstat).bytes.low == 0177) #define WIFTERMINATED(wstat) ((wstat).bytes.high == 0) --- 6,18 ---- #ifdef i386 ! union wait { struct { char low; char high; } bytes; short word; }; #define WSTOPPED 0177 #define w_status word #define w_termsig bytes.low #define w_stopsig bytes.high #define w_retcode bytes.high ! #define w_coredump w_termsig & 0200 #define WIFEXITED(wstat) ((wstat).bytes.low == 0) #define WIFSTOPPED(wstat) ((wstat).bytes.low == 0177) #define WIFTERMINATED(wstat) ((wstat).bytes.high == 0) ------------------------------------------------------------ Also, 386 5.3.2 systems (I don't know about other SYSV's) don't have SIGVTALRM or SIGPROF signals so the must be #ifdef'ed out of the 'terminating_signals' array in 'shell.c'. Other than that, 'bash' works great on my 386 5.3.2. Great job FSF! Tim Henrion Communications Software Engineer Banyan Systems, Inc. tim@banyan.banyan.com --or-- ...!buita!banyan!tim