Subject: Re: O_ASYNC on ttys
To: None <mouse@Rodents.Montreal.QC.CA>
From: maximum entropy <email@example.com>
Date: 07/07/2001 20:59:41
>Date: Sat, 7 Jul 2001 20:29:40 -0400 (EDT)
>From: der Mouse <mouse@Rodents.Montreal.QC.CA>
>>>> I'm fairly certain that this change would break the POSIX
>>>> conformance of our tcsetpgrp(3).
>> Sorry, by "this change" I meant der Mouse's suggested change to
>POSIX mandates that it must fail if the tty in question is not the
>controlling tty of the calling process's session? Then I submit -
>because of exactly what I want to do here - that POSIX is broken and
>should be ignored.
Yes. From section 184.108.40.206:
The file associated with _filedes_ must be the controlling
terminal of the calling process, and the controlling terminal
must be currently associated with the session of the controlling
But POSIX only defines the tcsetpgrp() interface; it's relevant only
because our current tcsetpgrp() uses TIOCSPGRP directly and assumes
the POSIX semantics are enforced there. It should be possible to get
the behavior you want without breaking tcsetpgrp().
>> After reading the thread in the archives, I'm not sure any of it is
>> necessary. O_ASYNC cares about the process group or PID indicated by
>> an earlier call to fcntl(fd, F_SETOWN, pid) call, not the process
>> group of a controlling tty. So der Mouse should be able to get the
>> SIGIO signals he wants without any kernel changes.
>I suggest you try it - or at least read the code - before saying such
>things. If you read the implementation of F_SETOWN, you'll see that it
>turns into a TIOCSPGRP call (except for sockets, for which it just
>bashes so_pgid - there may be a third alternative now for new-pipes; I
Sorry, I did read the code, but unfortunately I did so after sending
that mail :-/
See the retraction I posted shortly after that for an idea on how this
might be implented without breaking POSIX semantics, by divorcing
FIOSETOWN and TIOCSPGRP from each other.
entropy -- it's not just a good idea, it's the second law.