Subject: man audio - howto ioctl()
To: None <current-users@netbsd.org>
From: Sascha Retzki <sascha.retzki@t-online.de>
List: current-users
Date: 04/14/2004 16:27:17
Hi,

can somebody look at the audio(4) manpage and tell me how I ioctl()
that:

AUDIO_GETDEV (audio_device_t)
     This command fetches the current hardware device information into
     the audio_device_t argument.

             typedef struct audio_device {
                     char name[MAX_AUDIO_DEV_LEN];
                     char version[MAX_AUDIO_DEV_LEN];
                     char config[MAX_AUDIO_DEV_LEN];
             } audio_device_t;

because the ioctl() prototype: 
int ioctl(int fd, unsigned long expr,void *argp);
Does not allow ( in my opinion ) to write into a structure. How do I
make it ? I though about a more pratical implementation of the line:
AUDIO_GETDEV (audio_device_t)
and made:
ioctl(fd,AUDIO_GETDEV (audio_device_t),0);
which results in any other try I make:
parse error before "struct"
As I need these things ( this and some others structs ) to get the
card even working, it would be cool if someone could point me into the
right direction.


With kind regards


Sascha Retzki