io_eol_ctl(3I) — Series 300, 400, 800 Only
NAME
io_eol_ctl() − set up read termination character on special file
SYNOPSIS
#include <dvio.h>
int io_eol_ctl(int eid, int flag, int match);
DESCRIPTION
io_eol_ctl() specifies a character to be used in terminating a read operation from the specified file (entity identifier).
eid is an entity identifier of an open HP-IB raw bus, Centronics-compatible parallel, or GPIO device file obtained from an open(), dup(), fcntl(), or creat() call. flag is an integer that enables or disables character-match termination. A non-zero value enables character-match termination, while a zero value disables it. match is an integer containing the numerical equivalent of the termination character. match is ignored if flag is zero. When in 8-bit mode, the lower 8 bits of match are used as the termination character. In 16-bit mode, the lower 16 bits are used.
Upon opening a file, the default condition is character-match termination disabled. When enabled, the character specified by match is checked for during read operations. The read is terminated upon receipt of this character, or upon any of the other termination conditions normally in effect for this file. Examples of other conditions are satisfying the specified byte count, and receiving a character when the EOI line is asserted (HP-IB). When the read is terminated by a match character, this character is the last character returned in the buffer.
Entity identifiers for the same device file obtained by separate open() calls have their own termination characters associated with them. Entity identifiers for the same device file inherited by a fork() call share the same termination character. In the latter case, if one process changes the termination character, the new termination character is in effect for all such entity identifiers.
RETURN VALUE
io_eol_ctl() returns 0 (zero) if successful, or −1 if an error was encountered.
ERRORS
io_eol_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_eol_ctl() was developed by HP.
SEE ALSO
dup(2), creat(2), fcntl(2), open(2), io_width_ctl(3I).
Hewlett-Packard Company — HP-UX Release 9.0: August 1992