[Previous]
[Contents]
[Next]

console_state()

test and set the state of current events that are pending on a console

Synopsis:

#include <sys/console.h>
unsigned console_state( struct _console_ctrl *cc,
                        int console,
                        unsigned bits,
                        unsigned mask );

Description:

The console_state() function is used to test and set (or clear) the state of the current events that are pending on the console device indicated by console.

The argument cc is a pointer to a control structure that was returned by a previous call to console_open(). The argument console has a value of 1 to represent the device named /dev/con1, a value of 2 for /dev/con2, and so on. A value of 0 for console indicates the default console (that is, the one used by console_open()). A value of -1 for console indicates the currently visible console.

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.

Events are defined in <sys/console.h>, and include events such as:

_CON_EVENT_OUTPUT
Output has changed on this console.
_CON_EVENT_SIZE
The console has changed size.
_CON_EVENT_INACTIVE
The console is no longer visible.
_CON_EVENT_ACTIVE
The console is now visible.

Returns:

The console_state() function returns the current state of the console indicated by console. If an error occurs, -1 is returned, and errno is set.

Errors:

EINVAL
The control structure is in the wrong format.
ENXIO
The console value is invalid.

Examples:

See console_arm().

Classification:

QNX

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

See also:

console_active(), console_arm(), console_close(), console_ctrl(), console_font(), console_info(), console_open(), console_protocol(), console_read(), console_size(), console_write(), errno


[Previous]
[Contents]
[Next]