make a terminal device a controlling terminal
#include <sys/types.h> #include <unistd.h> int tcsetct( int fd, pid_t pid );
The tcsetct() function makes the terminal device associated with fd a controlling terminal that's associated with the process pid.
If successful, this call will cause subsequent hangup conditions on the indicated terminal device to generate a SIGHUP signal on the given process.
#include <sys/types.h>
#include <unistd.h>
void main()
{
/*
* Direct hangups on stdin to me
*/
tcsetct( 0, getpid() );
}
QNX
| Safety: | |
|---|---|
| Interrupt handler | No |
| Signal handler | Yes |
| Thread | Yes |