1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#include <sys/types.h> #include <unistd.h> #include "termios/_termios.h" pid_t tcgetpgrp(int fildes) { pid_t pid = -1; if (ioctl(fildes, TIOCGPGRP, &pid) == -1) { return (pid_t)-1; } return pid; } /* POSIX(1) */