chip@tct.uucp (Chip Salzenberg) (08/22/90)
Attempting to make Bash 1.05 work with the POSIX job control under SCO Unix 3.2.0, I've run into two bugs in SCO's POSIX implementation. I thought those SCO Unix users out there would like to know about them. (Perhaps SCO will also notice this report and fix the bugs. To dream the impossible dream... :-)) 1. The sigsuspend() function doesn't work in the presence of a handler for SIGCLD. Even when sigpending() shows that a SIGCLD is pending, sigsuspend() with an empty signal set does NOT call the SIGCLD handler. However, if SIGCLD is unmasked with sigprocmask(), the handler is called correctly. Therefore, this bug seems to be specific to sigsuspend(), and not to the general implementation of SIGCLD. This bug makes impossible the reliable handling of a single SIGCLD event, and is therefore quite serious. 2. The setpgid(0, 0) function makes the calling process the head of its own process group; this is as it should be. However, it also causes open("/dev/tty", O_RDWR) to fail, which is NOT as it should be. In addition, attempting to use a file descriptor still open to /dev/tty doesn't work. I only got job control to work somewhat by doing the tcgetpgrp() and tcsetpgrp() calls on stdin instead of /dev/tty. Oddly enough, system calls that failed on /dev/tty returned EIO, which is not in the list of error codes that are supposed to be returned by tcgetpgrp() and tcsetpgrp(). This bug is serious; separate control of process group and controlling tty is one of the most important features of POSIX job control. Because of these bugs, I did not succeed in getting Bash 1.05 to work with job control under SCO Unix 3.2.0. I understand that SCO Unix 3.2.2 includes ksh with job control. If this is true, perhaps the port of ksh revealed the above bugs, which means they're already fixed. Here's hoping... -- Chip Salzenberg at Teltronics/TCT <chip@tct.uucp>, <uunet!pdn!tct!chip>