Subject: Re: Should FIOSETOWN convert pids to pgrps?
To: None <>
From: Christos Zoulas <>
List: tech-kern
Date: 03/20/2003 14:39:29
In article <>,
David Laight <> wrote:

That sounds like the right solution to me.

>I've dug through all the sources again (fixing some man pages on the way).
>AFAICT nothing that uses tcsetpgrp() or TIOCSPGRP does async io.
>Indeed there are very few things that set FIOASYNC, O_ASYNC or FASYNC.
>(and one of them is ntp which doesn't like the current semantics).
>So it should be possible to:
>1) Pass the FIOSETOWN ioctl to the drivers, instead of converting it to
>2) Convert F_SETOWN to FIOSETOWN (fcntl to ioctl)
>3) Change everything except kern/tty.c to understand FIOSETOWN instead
>4) Make the tty code support TIOCSPGRP and FIOSETOWN as separate
>   functions

Clarification: the TIOCSPGRP should deal with job control, and FIOSETOWN
with async i/o, right?

>5) Use some common functions (in either kern_sig.c and/or kern_proc.c)
>   to process these requests.
>   I don't think they can be completely taken out of the driver code,
>   because the pgid/pid is a per-device item, not a per-file item.
>   (and there is no reference back from the device to the file
>   structure(s) ether.)
>If the code is done correctly, then the async io should grab a reference
>count against the pid/pgid in order to stop the pid being reallocated
>while the reference exists (only need one count per number).
>This would stop signals being sent to reallocated pids.