NAME
io_timeout_ctl() — establish a time limit for I/O operations (OBSOLETED AT 10.30)
SYNOPSIS
#include <dvio.h>
int io_timeout_ctl(int eid, long time);
DESCRIPTION
io_timeout_ctl()
assigns a timeout value to the specified
eid
(entity identifier).
eid
is an entity identifier of an open
HP-IB
raw bus, auto-addressed, Centronics-compatible parallel, or
GPIO
device file obtained from an
open(),
dup(),
fcntl(),
or
creat()
call.
time
is a long integer value
specifying the length of the timeout in microseconds.
A value of 0 for
time
specifies no timeout (infinity).
This timeout applies to future read and write requests on this
eid.
If a read or write request does not complete
within the specified time limit,
the request is aborted and returns an error indication.
If an operation is aborted due to a timeout,
errno
is set to
ETIMEDOUT.
Although the timeout value is specified in microseconds,
the resolution of the timeout is system-dependent.
For example, a particular system
might have a resolution of 10 milliseconds,
in which case the specified timeout value
is rounded up to the next 10 msec boundary.
A timeout value of zero means that the system never causes a timeout.
When a file is opened, a zero timeout value is assigned by default.
Entity identifiers for the same device file obtained by separate
open()
calls have their own timeout values associated with them.
Entity identifiers for the same device file obtained by
dup()
or inherited by a
fork()
call share the same timeout value.
In the latter case, if one process changes the timeout,
the new timeout is in effect for all such
eids.
RETURN VALUE
io_timeout_ctl()
returns 0 (zero) if successful, or -1 if an error was encountered.
ERRORS
io_timeout_ctl()
fails under the following circumstances, and sets
errno
(see
errno(2))
to the value indicated:
- [EBADF]
eid
does not refer to an open file.
- [ENOTTY]
eid
does not refer to a channel device file.
AUTHOR
io_timeout_ctl()
was developed by HP.