Date: Sun, 1 Sep 1996 13:13:38 +0200 (IST) From: Eli Zaretskii To: djgpp-workers AT delorie DOT com Subject: Termination codes of child programs Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII When a program launches a child program, it expects (on Unix) to get both its exit code and the signal, if any, that aborted that child. Our doesn't support extraction of the signal from the status returned by `system' and `spawnXX'. I used to hack the necessary defines into the programs' code, but after I found myself doing it for the third program in a row (find, xargs, and now Make), I think it's time to make it official. Especially, since the latest version of `dosexec' already puts SIGINT into the return status when the child was aborted with Ctrl-C. So how about the following change: *** include/sys/wait.h~0 Wed Aug 23 07:57:50 1995 --- include/sys/wait.h Sat Aug 31 19:05:18 1996 *************** *** 12,24 **** #include ! #define WEXITSTATUS(stat_val) ( (stat_val) & 0x00ff) ! #define WIFEXITED(stat_val) (!((stat_val) & 0xff00)) ! #define WIFSIGNALED(stat_val) ( ((stat_val) & 0xff00)) #define WIFSTOPPED(stat_val) 0 #define WNOHANG 1 #define WSTOPSIG(stat_val) 0 ! #define WTERMSIG(stat_val) ( (stat_val) & 0x00ff) #define WUNTRACED __DJ_pid_t --- 12,24 ---- #include ! #define WEXITSTATUS(stat_val) ( (stat_val) & 0x000ff) ! #define WIFEXITED(stat_val) (!((stat_val) & 0x3ff00)) ! #define WIFSIGNALED(stat_val) ( ((stat_val) & 0x3ff00)) #define WIFSTOPPED(stat_val) 0 #define WNOHANG 1 #define WSTOPSIG(stat_val) 0 ! #define WTERMSIG(stat_val) ( ((stat_val) >> 8 ) & 0x3ff) #define WUNTRACED __DJ_pid_t