Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/kern TIOCGSID is used by tcgetsid() so it is not really ...
details: https://anonhg.NetBSD.org/src/rev/699e8f81a7f5
branches: trunk
changeset: 955754:699e8f81a7f5
user: christos <christos%NetBSD.org@localhost>
date: Sat Oct 10 15:59:41 2020 +0000
description:
TIOCGSID is used by tcgetsid() so it is not really compat :-)
This should reduce loading the compat module.
diffstat:
sys/compat/common/tty_43.c | 18 ++----------------
sys/kern/tty.c | 17 +++++++++++++++--
2 files changed, 17 insertions(+), 18 deletions(-)
diffs (77 lines):
diff -r a2ee4ec7368f -r 699e8f81a7f5 sys/compat/common/tty_43.c
--- a/sys/compat/common/tty_43.c Sat Oct 10 15:34:05 2020 +0000
+++ b/sys/compat/common/tty_43.c Sat Oct 10 15:59:41 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tty_43.c,v 1.38 2020/10/09 10:41:53 nia Exp $ */
+/* $NetBSD: tty_43.c,v 1.39 2020/10/10 15:59:41 christos Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tty_43.c,v 1.38 2020/10/09 10:41:53 nia Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tty_43.c,v 1.39 2020/10/10 15:59:41 christos Exp $");
#if defined(_KERNEL_OPT)
#include "opt_compat_netbsd.h"
@@ -277,20 +277,6 @@
mutex_spin_exit(&tty_lock);
break;
- case TIOCGSID:
- mutex_enter(&proc_lock);
- if (tp->t_session == NULL) {
- mutex_exit(&proc_lock);
- return ENOTTY;
- }
- if (tp->t_session->s_leader == NULL) {
- mutex_exit(&proc_lock);
- return ENOTTY;
- }
- *(int *) data = tp->t_session->s_leader->p_pid;
- mutex_exit(&proc_lock);
- break;
-
default:
return (EPASSTHROUGH);
}
diff -r a2ee4ec7368f -r 699e8f81a7f5 sys/kern/tty.c
--- a/sys/kern/tty.c Sat Oct 10 15:34:05 2020 +0000
+++ b/sys/kern/tty.c Sat Oct 10 15:59:41 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tty.c,v 1.291 2020/10/10 14:07:18 nia Exp $ */
+/* $NetBSD: tty.c,v 1.292 2020/10/10 15:59:41 christos Exp $ */
/*-
* Copyright (c) 2008, 2020 The NetBSD Foundation, Inc.
@@ -63,7 +63,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tty.c,v 1.291 2020/10/10 14:07:18 nia Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tty.c,v 1.292 2020/10/10 15:59:41 christos Exp $");
#ifdef _KERNEL_OPT
#include "opt_compat_netbsd.h"
@@ -1377,6 +1377,19 @@
s != tp->t_qsize)
error = tty_set_qsize(tp, s);
return error;
+ case TIOCGSID:
+ mutex_enter(&proc_lock);
+ if (tp->t_session == NULL) {
+ mutex_exit(&proc_lock);
+ return ENOTTY;
+ }
+ if (tp->t_session->s_leader == NULL) {
+ mutex_exit(&proc_lock);
+ return ENOTTY;
+ }
+ *(int *) data = tp->t_session->s_leader->p_pid;
+ mutex_exit(&proc_lock);
+ break;
case TIOCSBRK:
case TIOCCBRK:
Home |
Main Index |
Thread Index |
Old Index