summaryrefslogtreecommitdiffstats
path: root/sys/kern/tty.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/tty.c')
-rw-r--r--sys/kern/tty.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/kern/tty.c b/sys/kern/tty.c
index 076a35c..97fc0cc 100644
--- a/sys/kern/tty.c
+++ b/sys/kern/tty.c
@@ -1010,6 +1010,11 @@ ttioctl(struct tty *tp, u_long cmd, void *data, int flag)
return (ENOTTY);
*(int *)data = tp->t_pgrp ? tp->t_pgrp->pg_id : NO_PID;
break;
+ case TIOCGSID: /* get sid of tty */
+ if (!isctty(p, tp))
+ return (ENOTTY);
+ *(int *)data = tp->t_session->s_sid;
+ break;
#ifdef TIOCHPCL
case TIOCHPCL: /* hang up on last close */
s = spltty();
OpenPOWER on IntegriCloud