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.
The tcsetpgrp() function returns zero if successful; otherwise, it returns (-1), and sets errno.
errno, signal(), tcgetpgrp(), tcsetct()
#include <sys/types.h> #include <unistd.h> void main() { /* * Direct breaks on stdin to me */ tcsetpgrp( 0, getpid() ); }
POSIX 1003.1
QNX