summaryrefslogtreecommitdiff
path: root/lib/libc/termios/tcgetsid.c
blob: 076cf3602fb01fd36ebe5af4f3a3e779016b914c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <termios.h>
#include <syscall.h>
#include <asm-generic/ioctls.h>

pid_t tcgetsid(int fildes)
{
	pid_t sid = 0;

	if (syscall(ioctl, fildes, TIOCGSID, &sid) < 0)
		return -1;

	return sid;
}