[Previous]
[Contents]
[Next]

dev_state()

test, and set or clear, events that are pending on a terminal device

Synopsis:

#include <sys/dev.h>
unsigned dev_state( int fd,
                    unsigned bits,
                    unsigned mask );

Description:

The dev_state() function is used to test and set (or clear) the state of the current events that are pending on the terminal device associated with fd.

Any event bits that are set in mask are set to the corresponding bit in bits. The value of the event state before this operation is applied is returned. For a description of the events, see dev_arm().

Returns:

The current state of the terminal device associated with fd. If an error occurs, -1 is returned and errno is set.

Errors:

EBADF
The file descriptor is invalid.
EINVAL
One of the arguments is invalid.
ENOSYS
This function is not supported for this fd.

Examples:

See dev_arm().

Classification:

QNX

Safety:
Interrupt handler No
Signal handler Yes, but modifies errno
Thread Yes

See also:

dev_arm(), dev_info(), errno


[Previous]
[Contents]
[Next]