Subject: Re: /dev/audioctl emulation?
To: None <port-sparc@NetBSD.ORG>
From: Greg Earle <earle@isolar.tujunga.ca.us>
List: port-sparc
Date: 03/09/1996 04:34:48
>> I tried making a phony /dev/audioctl device (i.e. made it the same as
>> /dev/audio) to fool it, but alas, it tries some ioctl() that returns an
>> error under NetBSD and thus it fails.
> 
> It's probably doing an I_FLUSH.  This is common in code written for
> SunOS or Solaris.  It could be emulated by doing the same thing that
> AUDIO_FLUSH does.

Ooh!  Close, Charles.  Actually, it turns out to be an I_SETSIG.  It seems
to be required for audio code which wants to be notified of changes made
to the audio parameters via the control device (/dev/audioctl).  (Because
the SunOS audio device is actually a STREAMS-based device.)

It turns out that this STREAMS ioctl() is handled in the 1.1/-current version
of /usr/src/sys/compat/sunos_ioctl.c - albeit with a tiny buglet: the code says

        case _IO('S', 9):       /* I_SIGSET */

but it's actually "I_SETSIG", not "I_SIGSET":

isolar:1:244 % egrep SETSIG /usr/include/stropts.h
#define I_SETSIG        _IO(S,011)

So, once again I slink off and hang my head in shame for still running ancient
software (1.0) ...  :-)

	- Greg