open_mode
Pattara Kiatisevi
pkiatisevi at student.ei.uni-stuttgart.de
Mon Feb 11 12:25:57 UTC 2002
Hi,
I'm working further on my sound driver in the sound_open() function.
>From application code I do:
audio_fd = open("/dev/dsp", 4, 1)
And then in the driver code:
rtems_device_driver sound_open(
rtems_device_major_number major,
rtems_device_minor_number minor,
void * arg
)
{
rtems_libio_open_close_args_t *args = arg;
/* Only write-only mode is supported now */
printf("args->flags is 0x%4X\n", args->flags);
printf("args->mode is 0x%4X\n", args->mode);
if ( args->flags == 0x0004 ) {
printf("/dev/dsp opened...\n");
return RTEMS_SUCCESSFUL;
} else {
return RTEMS_NOT_IMPLEMENTED;
}
Hmm, but amazing (to me) is that the debugged output said:
args->flags is 0x 103
args->mode is 0x 1
/dev/dsp: Permission denied
Hmm, the flag I sent was "4" or "0x0004" but how could it become 0x103?
Anybody has idea?
Thank you,
Pattara}
The best things in life are free. - B.G. DeSilva (1927)
----------------------------------------------------------------------
Ott Pattara Kiatisevi T L W G
M.Sc. INFOTECH Student, Stuttgart, Germany http://linux.thai.net/
----------------------------------------------------------------------
More information about the users
mailing list