aboutsummaryrefslogtreecommitdiff
path: root/src/unistd/tcgetpgrp.c
blob: 1924a406a8ca857daf5107fa487f97b6c2106825 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <unistd.h>
#include <termios.h>
#include <sys/ioctl.h>

pid_t tcgetpgrp(int fd)
{
	int pgrp;
	if (ioctl(fd, TIOCGPGRP, &pgrp) < 0)
		return -1;
	return pgrp;
}


#ifdef TEST
int
main(void) {
	return 0;
}
#endif