Updated: April 19, 2023 |
Make a terminal device a controlling device
#include <termios.h> int tcsetsid( const int filedes, const pid_t pid );
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
The tcsetsid() function makes the terminal device associated with the file descriptor argument filedes into a controlling terminal that's associated with the process pid. If successful, this call causes subsequent hangup conditions on the terminal device filedes to generate a SIGHUP signal on the given process.
This call is equivalent to calling ioctl( filedes, TIOCSCTTY ) to set the controlling terminal to the current process. You can clear the controlling terminal by passing -1 as filedes.
Safety: | |
---|---|
Cancellation point | No |
Interrupt handler | No |
Signal handler | No |
Thread | Yes |