set bits in the control word for a console
#include <sys/console.h> unsigned console_ctrl( struct _console_ctrl *cc, int console, unsigned bits, unsigned mask );
The console_ctrl() function sets any bits in the console control word for this console that are indicated in mask to be the corresponding value given in bits.
The previous, unmodified control word is returned.
Console control bits are defined in <sys/console.h>, and include at least the following:
The previous, unmodified control word. If an error is encountered, -1 is returned and errno is set.
#include <sys/console.h> #include <fcntl.h> #include <unistd.h> int main( void ) { struct _console_ctrl *cc; int fd, old; /* * Open up a channel to the console driver */ fd = open( "/dev/con1", O_RDWR ); cc = console_open( fd, O_RDWR ); close( fd ); /* * Suppress console switching */ old = console_ctrl( cc, 0, CONSOLE_NOSWITCH, CONSOLE_NOSWITCH ); /* * Restore console switching to previous state */ console_ctrl( cc, 0, old, CONSOLE_NOSWITCH ); /* * Close the channel */ console_close( cc ); return (EXIT_SUCCESS); }
QNX
Safety: | |
---|---|
Interrupt handler | No |
Signal handler | Yes, but modifies errno |
Thread | Yes |
console_active(), console_arm(), console_close(), console_font(), console_info(), console_open(), console_protocol(), console_read(), console_size(), console_state(), console_write(), errno