Path: utzoo!attcan!uunet!shelby!leland.Stanford.EDU!news From: sidana@leland.Stanford.EDU (Ashmeet Sidana) Newsgroups: comp.unix.questions Subject: ioctl, flush fails - help! Keywords: ioctl, I_FLUSH, help ! Message-ID: <1991Mar2.214348.19521@leland.Stanford.EDU> Date: 2 Mar 91 21:43:48 GMT Sender: news@leland.Stanford.EDU (Mr News) Organization: Stanford University - AIR Lines: 34 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 #include 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@leland.stanford.edu Thank you, ---Ashmeet Sidana sidana@leland.stanford.edu