IO_EOL_CTL(3I) — HP-UX
NAME
io_eol_ctl − set up read termination character on special file
SYNOPSIS
int io_eol_ctl (eid, flag, match);
int eid, flag, match;
DESCRIPTION
Io_eol_ctl enables you to specify a character to be used in terminating a read operation from the specified file 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. Flag is an integer which 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 ids for the same device file obtained by separate open(2) requests have their own termination characters associated with them. Entity ids for the same device file inherited by a fork(2) request 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 ids.
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 in square brackets:
[EBADF] eid does not refer to an open file [EBADF];
[ENOTTY] eid does not refer to a channel device file.
DEPENDENCIES
Series 500
When termination is requested in 16-bit mode, the upper byte of the halfword is examined first, and then the lower byte. If the lower byte matches the termination character, all is as expected. However, if the upper byte matches, the following action is taken:
both the upper and lower bytes are moved into the given buffer; and the count returned is odd, indicating that there is a lower byte following the matching upper byte. This information is passed to the upper level software to deal with as it pleases.
Series 800
Termination patterns are associated with a given device. Therefore, multiple opens of the same device share termination characters.
The GPIO interface does not support this function.
AUTHOR
Io_eol_ctl was developed by HP.
SEE ALSO
Hewlett-Packard Company — Version B.1, May 11, 2021