HPlogo HP-UX Reference Volume 4 of 5 > i

io_get_term_reason(3I)

Series 800 Only
» 

Technical documentation

Complete book in PDF

 » Table of Contents

 » Index

NAME

io_get_term_reason() — determine how last read terminated (OBSOLETED AT 10.30)

SYNOPSIS

#include <dvio.h>

int io_get_term_reason(int eid);

DESCRIPTION

io_get_term_reason() returns the termination reason for the last read made on this entity id. eid is an entity identifier of an open HP-IB raw bus, Centronics-compatible parallel interface, or GPIO device file obtained from an open(), dup(), fcntl(), or creat() call.

All entity identifiers descending from an open() request (such as from dup() or fork()) set this status. For example, if the calling process had opened this entity identifier and later forked, the status returned would be from the last read done by either the calling process or its child.

RETURN VALUE

io_get_term_reason() returns a value indicating how the last read on the specified entity identifier was terminated. This value is interpreted as follows (note that combinations are possible):

  • ValueDescription
    -1An error was encountered while making this function request.
    0Last read encountered some abnormal termination reason not covered by any of the other reasons.
    1Last read terminated by reading the number of bytes requested.
    2Last read terminated by detecting the specified termination character.
    4Last read terminated by detecting some device-imposed termination condition. Examples are: EOI for HP-IB, PSTS line on GPIO, or some other end-of-record condition, such as the physical end-of-record mark on a 9-track tape.

ERRORS

io_get_term_reason() 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_get_term_reason() was developed by HP.

© Hewlett-Packard Development Company, L.P.