Subject: Use of TIOCSPGRP in device drivers
To: None <tech-kern@netbsd.org>
From: Dave McConnell <davem@eastcoast.co.za>
List: tech-kern
Date: 05/27/1999 14:46:38
Hi

I see in the driver code dev/audio.c, the TIOCSPGRP entry to the 
audio_ioctl is not used to set the process which may receive a 
SIGIO.

Instead the "p" argument is used in the FIOASYNC entry (to 
audio_ioctl) to record the process that wishes to receive SIGIO's.

Is this correct? I assume its not "incorrect" as it will work.

I believe  that the "correct" way for a process to request SIGIO's 
from a device is to do an "fcntl" with command F_SETOWN 
(translates to a TIOCSPGRP in the drivers ioctl) to identify the 
process or group ID wanting the signals, and then to do another 
"fcntl" to set the O_ASYNC flag.

Dave