diff options
author | davidxu <davidxu@FreeBSD.org> | 2008-04-15 08:33:32 +0000 |
---|---|---|
committer | davidxu <davidxu@FreeBSD.org> | 2008-04-15 08:33:32 +0000 |
commit | a19eeb1bb90be407b05f596feb555c76224c1e2b (patch) | |
tree | 437a345c58351750a20a52bed0bde3fe8b3c2678 /lib/libc/gen/termios.c | |
parent | c25466ababd0aab3cbbb2d2aed863d6dcf836055 (diff) | |
download | FreeBSD-src-a19eeb1bb90be407b05f596feb555c76224c1e2b.zip FreeBSD-src-a19eeb1bb90be407b05f596feb555c76224c1e2b.tar.gz |
Implement POSIX function tcgetsid() which returns session id.
PR: stand/107561
Diffstat (limited to 'lib/libc/gen/termios.c')
-rw-r--r-- | lib/libc/gen/termios.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/libc/gen/termios.c b/lib/libc/gen/termios.c index 333dff4..4c6dcff 100644 --- a/lib/libc/gen/termios.c +++ b/lib/libc/gen/termios.c @@ -99,6 +99,17 @@ tcgetpgrp(fd) return ((pid_t)s); } +pid_t +tcgetsid(int fd) +{ + int s; + + if (_ioctl(fd, TIOCGSID, &s) < 0) + return ((pid_t)-1); + + return ((pid_t)s); +} + speed_t cfgetospeed(t) const struct termios *t; |