Subject: async I/O internals
To: None <tech-kern@NetBSD.ORG>
From: None <frank@fwi.uva.nl>
List: tech-kern
Date: 10/07/1995 22:35:08
I stumbled onto the following problem:

fcntl(fd, F_{G,S}ETOWN) is based on ioctl(fd, TIOC{G,S}PGRP), and always
has been in BSD kernels as far as I know. This has always worked fine,
but somewhere along the line an extra check was added to TIOC{S,G}PGRP,
to only allow it on controlling terminals (plus a check on the session).
This makes sense, and was probably done for the POSIX compliance of
tcsetpgrp().

However, this breaks F_{G,S}ETOWN in some cases: you can't do asynchronous
I/O anymore on terminal devices that are not the controlling terminal for
the process. Which is a nuisance, because you just might want to use it on,
for example, a serial line.

So, that's why the question rises: was this intentional? Or was
the effect this would have on the (little used) asynchronous I/O
calls overseen? Perhaps it would be better to de-couple the
'owner' notion of F_{G,S}ETOWN, SIGIO & friends from the process
group associated with a terminal?

- Frank