From: Vincent Arkesteijn <vincent@ar...> - 2003-05-20 12:53:37
Recently I've been playing a bit with sb-grovel and
sb-unix:unix-ioctl to control my soundcard under Linux. I ran
into a small problem with unix-ioctl doing this. I'm using
sb-unix:unix-ioctl declares it's CMD argument to be of type
(unsigned-byte 32). However, the ioctl man page on both Linux
and HP-UX declare the second argument of ioctl() to be of type
int. Also, both sb-grovel and tools-for-build/grovel_headers.c
print these as (signed) integers.
This presented a problem when using some ioctl commands from
linux/soundcard.h, which I had converted using sb-grovel. For
instance, OSS_GETVERSION and about half of the SNDCTL_DSP_*
commands are negative when interpreted as a signed integer.
Would it be a good idea to change the declaration in unix-ioctl
to (signed-byte 32)?
On a slightly unrelated note: would it be possible to let the C
file generated by sb-grovel always include stdio.h? After all,
it does use printf().
From: Daniel Barlow <dan@te...> - 2003-05-22 14:39:44
=2D----BEGIN PGP SIGNED MESSAGE-----
Vincent Arkesteijn <vincent@...> writes:
> sb-unix:unix-ioctl declares it's CMD argument to be of type
> (unsigned-byte 32). However, the ioctl man page on both Linux
> and HP-UX declare the second argument of ioctl() to be of type
> int. Also, both sb-grovel and tools-for-build/grovel_headers.c
> print these as (signed) integers.
OK, it should probbaly be signed - thanks for finding this. Note
however that SB-UNIX is an internal implementation package and not
guaranteed to remain available for client code. You probably want to
either define your own glue for ioctl (possibly using sb-grovel if
it's useful), or to propose an interface that fits the SB-POSIX=20
> On a slightly unrelated note: would it be possible to let the C
> file generated by sb-grovel always include stdio.h? After all,
> it does use printf().
Yes, that sounds like a good idea.
http://www.cliki.net/ - Link farm for free CL-on-Unix resources=20
=2D----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.8 <http://mailcrypt.sourceforge.net/>
=2D----END PGP SIGNATURE-----