home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!auspex-gw!guy
- From: guy@Auspex.COM (Guy Harris)
- Newsgroups: comp.sys.sun.hardware
- Subject: Re: Using /dev/audio in applications
- Message-ID: <14485@auspex-gw.auspex.com>
- Date: 5 Sep 92 01:00:51 GMT
- References: <1992Sep4.204344.22328@news.Hawaii.Edu>
- Sender: news@auspex-gw.auspex.com
- Organization: Auspex Systems, Santa Clara
- Lines: 13
- Nntp-Posting-Host: bootme.auspex.com
-
- >BUT, the application will hang if some other process is using /dev/audio.
- >I though the O_NONBLOCK would prevent this.
- >
- >Can anyone provide a simple solution. Or point out my error?
-
- Your error is that you assumed Sun's driver would properly handle the
- new POSIX O_NONBLOCK flag on an open.
-
- It doesn't; try using O_NDELAY instead (either the BSD or SV version).
- If O_NDELAY is used in an open, and some other process has the device open,
- the open should return -1 and set "errno" to EBUSY.
-
- Note that you may want to turn O_NDELAY *off* once the device is opened.
-