set the process group ID for a device
#include <sys/types.h> #include <unistd.h> int tcsetpgrp( int fildes, pid_t pgrp_id );
The tcsetpgrp() function sets the process group ID associated with the device indicated by fildes to be pgrp_id.
If successful, the tcsetpgrp() function will cause subsequent breaks on the indicated terminal device to generate a SIGINT on all process in the given process group.
#include <sys/types.h>
#include <unistd.h>
void main()
{
/*
* Direct breaks on stdin to me
*/
tcsetpgrp( 0, getpid() );
}
POSIX 1003.1
| Safety: | |
|---|---|
| Interrupt handler | No |
| Signal handler | Yes |
| Thread | Yes |
errno, signal(), tcgetpgrp(), tcsetct()