libcdio-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Libcdio-devel] open(x, O_RDONLY|O_NONBLOCK) vs. O_RDONLY) on FreeBS


From: Burkhard Plaum
Subject: Re: [Libcdio-devel] open(x, O_RDONLY|O_NONBLOCK) vs. O_RDONLY) on FreeBSD (Solaris, GNU/Linux)?
Date: Mon, 09 May 2005 19:35:38 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.7) Gecko/20050417 Fedora/1.7.7-1.3.1

The only time it makes a difference is when the drive is empty.  If
there's a disc in the drive then both methods will work.  But if the
drive is empty then the kernel will fail the open unless you specify
O_NONBLOCK (in a way that's saying you want to talk to the drive rather than the media).

There has been some discussion if a CdIo_t object always refers to a disk,
or if can also refer to an empty drive. The BSD behaviour regarding O_NONBLOCK
is identical to Linux. An empty drive can be detected by checking if
cdio_get_last_track_num() returns CDIO_INVALID_TRACK.
Maybe a simple boolean cdio_has_media() would be better?

The question is, can we make a uniform behaviour on all supported
architectures?

--
_____________________________
Dr.-Ing. Burkhard Plaum
Institut fuer Plasmaforschung
Pfaffenwaldring 31
70569 Stuttgart
Tel.: +49 711 685-2187
Fax.:            -3102




reply via email to

[Prev in Thread] Current Thread [Next in Thread]