ioctl, flush fails - help!
Ashmeet Sidana
sidana at leland.Stanford.EDU
Sun Mar 3 07:43:48 AEST 1991
I am trying to flush the audio device to which I have previously written
a large no of bytes on a SUN SparcStation 1. However, the ioctl fails
with an "invalid argument" error.
My sample code is as follows:
#include <fcntl.h>
#include <stropts.h>
char notes[20000];
main()
{
int i,fdaudio;
fdopen ((fdaudio = open("/dev/audio",O_WRONLY)),"w");
fill_notes_array();
write (fdaudio,notes,20000);
if ((ioctl (fdaudio,I_FLUSH,FLUSHW)) < 0) { /*this is where it fails !*/
perror ("Fatal Error: ioctl failed");
exit (-1);
}
else
printf ("ioctl succeeded! \n");
}
Any help would be appreciated !!!
Please send me email at: sidana at leland.stanford.edu
Thank you,
---Ashmeet Sidana
sidana at leland.stanford.edu
More information about the Comp.unix.questions
mailing list