summaryrefslogtreecommitdiff
path: root/src/unistd/tcgetpgrp.c
blob: 40b60a7eaab9781f84d0fcbac45343e117238424 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include "stddef.h"
#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)
*/