On Wed, 2 Apr 2008, Robert Hancock wrote:
Kai Makisara wrote:...On Tue, 1 Apr 2008, Carlo Nyto wrote:
I am experiencing a two minute timeout open()ing a tape device whenThis is how open() is supposed to work according to standards (e.g., SUS) if
there is no tape in the drive.
open() with O_NONBLOCK succeeds immediately, however.
O_NONBLOCK is supported. (Well, actually open() should wait indefinitely but
the non-linux systems I tested had a timeout.) The linux st driver was
changed to comply with standards at 2.5.3. I.e., the 2.4 kernels did return
immediately but the 2.6 kernels have always waited.
Why is accessing the tape drive with no tape in it causing a timeout in theIt does not seem retarded to me. If a program wants to just wait until the tape drive becomes ready (e.g., loads the tape), it can use the blocking open. This is simple. If a program wants to test the status, it uses non-blocking open. The behavior mandated by the standards provides alternatives. If O_NONBLOCK is not supported, the user program must implement the waiting logic if the program just wants to wait until the drive is ready before starting i/o.
first place? I should think that would fail immediately with some "medium not
present" error from the drive. Unless the drive has no mechanism to detect it,
but that seems really retarded..