Hi,
Now that wscons is using sigio, adding support for FIOSETOWN/TIOCGPGRP
is trivial.
Also, visa@ pointed out that FIOSETOWN gets translated into TIOCSPGRP by
sys_ioctl(), handling of FIOSETOWN is therefore redundant.
Comments? OK?
Index: wskbd.c
===================================================================
RCS file: /cvs/src/sys/dev/wscons/wskbd.c,v
retrieving revision 1.92
diff -u -p -r1.92 wskbd.c
--- wskbd.c 19 Nov 2018 19:19:24 -0000 1.92
+++ wskbd.c 19 Nov 2018 20:11:52 -0000
@@ -957,12 +957,13 @@ wskbd_do_ioctl_sc(struct wskbd_softc *sc
sc->sc_base.me_evp->async = *(int *)data != 0;
return (0);
- case FIOSETOWN:
+ case TIOCGPGRP:
evar = sc->sc_base.me_evp;
if (evar == NULL)
return (EINVAL);
- return (sigio_setown(&evar->sigio, *(int *)data));
-
+ *(int *)data = -sigio_getown(&evar->sigio);
+ return (0);
+
case TIOCSPGRP:
if (*(int *)data < 0)
return (EINVAL);
Index: wsmouse.c
===================================================================
RCS file: /cvs/src/sys/dev/wscons/wsmouse.c,v
retrieving revision 1.48
diff -u -p -r1.48 wsmouse.c
--- wsmouse.c 19 Nov 2018 19:19:24 -0000 1.48
+++ wsmouse.c 19 Nov 2018 20:11:53 -0000
@@ -482,7 +482,6 @@ wsmouse_do_ioctl(struct wsmouse_softc *s
switch (cmd) {
case FIOASYNC:
- case FIOSETOWN:
case TIOCSPGRP:
if ((flag & FWRITE) == 0)
return (EACCES);
@@ -498,11 +497,12 @@ wsmouse_do_ioctl(struct wsmouse_softc *s
sc->sc_base.me_evp->async = *(int *)data != 0;
return (0);
- case FIOSETOWN:
+ case TIOCGPGRP:
evar = sc->sc_base.me_evp;
if (evar == NULL)
return (EINVAL);
- return (sigio_setown(&evar->sigio, *(int *)data));
+ *(int *)data = -sigio_getown(&evar->sigio);
+ return (0);
case TIOCSPGRP:
if (*(int *)data < 0)
Index: wsmux.c
===================================================================
RCS file: /cvs/src/sys/dev/wscons/wsmux.c,v
retrieving revision 1.33
diff -u -p -r1.33 wsmux.c
--- wsmux.c 19 Nov 2018 19:19:24 -0000 1.33
+++ wsmux.c 19 Nov 2018 20:11:53 -0000
@@ -470,12 +470,12 @@ wsmux_do_ioctl(struct device *dv, u_long
return (EINVAL);
evar->async = *(int *)data != 0;
return (0);
- case FIOSETOWN:
- DPRINTF(("%s: FIOSETOWN\n", sc->sc_base.me_dv.dv_xname));
+ case TIOCGPGRP:
evar = sc->sc_base.me_evp;
if (evar == NULL)
return (EINVAL);
- return (sigio_setown(&evar->sigio, *(int *)data));
+ *(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)