[Previous]
[Contents]
[Next]

console_open()

open a control channel to a console

Synopsis:

#include <sys/console.h>
struct _console_ctrl *console_open( int fd,
                               unsigned mode );

Description:

The console_open() function opens a control channel to the device driver of a console device. The device must be a console device, and must have been previously opened. The fd argument refers to this opened device.

The mode argument is an access mode (see <fcntl.h>). The only supported mode is O_RDWR.

A pointer to an allocated control structure is returned, which is to be used by subsequent console functions.

The console class of functions allow direct reads and writes to the console device for high speed I/O to such devices.

Returns:

The console_open() function returns a pointer to a control structure that is used in subsequent calls to the other console functions. On error, NULL is returned, and errno is set.

Errors:

EBADF
The argument fd is invalid.
EINVAL
The argument mode is invalid.
ENOMEM
There isn't enough memory to allocate a control structure.
ENOSYS
The file descriptor doesn't refer to a console device.

Examples:

See console_read().

Classification:

QNX

Safety:
Interrupt handler No
Signal handler No
Thread Yes

See also:

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


[Previous]
[Contents]
[Next]