IO_TIMEOUT_CTL(3I) — HP-UX
NAME
io_timeout_ctl − establish a time limit for I/O operations
SYNOPSIS
int io_timeout_ctl (eid, time);
int eid;
long time;
DESCRIPTION
Io_timeout_ctl enables you to assign a timeout value to the specified entity id. Eid is an entity identifier of an open HP-IB raw bus or GPIO device file obtained from an open(2), dup(2), fcntl(2), or creat(2) call. Time is a 32-bit integer value specifying the length of the timeout in microseconds.
This timeout applies to future read and write requests on this entity id. 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(2) is set to ETIMEOUT.
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 ids for the same device file obtained by separate open(2) requests have their own timeout values associated with them. Entity ids for the same device file obtained by dup(2) or inherited by a fork(2) request share the same timeout value. In the latter case, if one process changes the timeout, the new timeout is in effect for all such entity ids.
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 in square brackets:
[EBADF] eid does not refer to an open file.
[ENOTTY] eid does not refer to a channel device file.
DEPENDENCIES
Series 300
System timeout resolution is 20 msec.
Series 500
The errno value for a timed-out request is EIO, specifying that a timeout has occurred. An errinfo value of 56 is returned.
Series 800
Timeouts are associated with a given device. Therefore, multiple opens of the same device share timeouts.
AUTHOR
Io_timeout_ctl was developed by HP.
Hewlett-Packard Company — Version B.1, May 11, 2021