summaryrefslogtreecommitdiff
path: root/src/unistd/tcgetpgrp.c
blob: f2924d5f2974ee87ce8c88df9cf2443c0c4165a7 (plain)
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)
*/