summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authoranton <anton@cvs.openbsd.org>2018-11-20 19:33:45 +0000
committeranton <anton@cvs.openbsd.org>2018-11-20 19:33:45 +0000
commitf56c514771569be071318dbde651be1b01f73e3d (patch)
treec4873e2b4622600eb4b61876b7ddeecb4cd82fe5 /sys
parent37e5c274696398fc273e28a2a4b315838fd6bfcd (diff)
Add support for TIOCGPGRP ioctl commands to wscons.
ok visa@
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/wscons/wskbd.c9
-rw-r--r--sys/dev/wscons/wsmouse.c9
-rw-r--r--sys/dev/wscons/wsmux.c9
3 files changed, 24 insertions, 3 deletions
diff --git a/sys/dev/wscons/wskbd.c b/sys/dev/wscons/wskbd.c
index 7cbe9a06663..a90917605ad 100644
--- a/sys/dev/wscons/wskbd.c
+++ b/sys/dev/wscons/wskbd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wskbd.c,v 1.93 2018/11/20 19:00:13 anton Exp $ */
+/* $OpenBSD: wskbd.c,v 1.94 2018/11/20 19:33:44 anton Exp $ */
/* $NetBSD: wskbd.c,v 1.80 2005/05/04 01:52:16 augustss Exp $ */
/*
@@ -957,6 +957,13 @@ wskbd_do_ioctl_sc(struct wskbd_softc *sc, u_long cmd, caddr_t data, int flag,
sc->sc_base.me_evp->async = *(int *)data != 0;
return (0);
+ case TIOCGPGRP:
+ evar = sc->sc_base.me_evp;
+ if (evar == NULL)
+ return (EINVAL);
+ *(int *)data = -sigio_getown(&evar->sigio);
+ return (0);
+
case TIOCSPGRP:
if (*(int *)data < 0)
return (EINVAL);
diff --git a/sys/dev/wscons/wsmouse.c b/sys/dev/wscons/wsmouse.c
index e26cad28f70..981b8c09d18 100644
--- a/sys/dev/wscons/wsmouse.c
+++ b/sys/dev/wscons/wsmouse.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wsmouse.c,v 1.49 2018/11/20 19:00:13 anton Exp $ */
+/* $OpenBSD: wsmouse.c,v 1.50 2018/11/20 19:33:44 anton Exp $ */
/* $NetBSD: wsmouse.c,v 1.35 2005/02/27 00:27:52 perry Exp $ */
/*
@@ -497,6 +497,13 @@ wsmouse_do_ioctl(struct wsmouse_softc *sc, u_long cmd, caddr_t data, int flag,
sc->sc_base.me_evp->async = *(int *)data != 0;
return (0);
+ case TIOCGPGRP:
+ evar = sc->sc_base.me_evp;
+ if (evar == NULL)
+ return (EINVAL);
+ *(int *)data = -sigio_getown(&evar->sigio);
+ return (0);
+
case TIOCSPGRP:
if (*(int *)data < 0)
return (EINVAL);
diff --git a/sys/dev/wscons/wsmux.c b/sys/dev/wscons/wsmux.c
index 16b57c880d6..b85495c605b 100644
--- a/sys/dev/wscons/wsmux.c
+++ b/sys/dev/wscons/wsmux.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wsmux.c,v 1.34 2018/11/20 19:00:13 anton Exp $ */
+/* $OpenBSD: wsmux.c,v 1.35 2018/11/20 19:33:44 anton Exp $ */
/* $NetBSD: wsmux.c,v 1.37 2005/04/30 03:47:12 augustss Exp $ */
/*
@@ -470,6 +470,13 @@ wsmux_do_ioctl(struct device *dv, u_long cmd, caddr_t data, int flag,
return (EINVAL);
evar->async = *(int *)data != 0;
return (0);
+ case TIOCGPGRP:
+ DPRINTF(("%s: TIOCGPGRP\n", sc->sc_base.me_dv.dv_xname));
+ evar = sc->sc_base.me_evp;
+ if (evar == NULL)
+ return (EINVAL);
+ *(int *)data = -sigio_getown(&evar->sigio);
+ return (0);
case TIOCSPGRP:
DPRINTF(("%s: TIOCSPGRP\n", sc->sc_base.me_dv.dv_xname));
if (*(int *)data < 0)