TIOCCONS
(2const)redirecting console output
#include <asm/termbits.h> /* Definition of TIOCCONS */ #include <sys/ioctl.h> int ioctl(int fd, TIOCCONS);
LIBRARY
DESCRIPTION
Redirect output that would have gone to /dev/console or /dev/tty0 to the given terminal. If that was a pseudoterminal master, send it to the slave.
Only a process with the CAP_SYS_ADMIN capability may do this.
If output was redirected already, then EBUSY is returned, but redirection can be stopped by using this ioctl with fd pointing at /dev/console or /dev/tty0.