Re: cvs commit: src/sys/dev/kbdmux kbdmux.c

From: Ruslan Ermilov <ru_at_freebsd.org>
Date: Wed, 20 Sep 2006 09:57:15 +0400
On Wed, Sep 20, 2006 at 12:14:04AM +0200, Marius Strobl wrote:
> On Wed, Sep 20, 2006 at 01:56:05AM +0400, Ruslan Ermilov wrote:
> > 
> > The proper fix would be to fix the kernel to pass an argument by
> > value, like the userland does.  But from the practical point of
> > view, it may make sense to change the API and say that these
> > IOCTLs now take a pointer type argument.  I'm not sure.  If you
> > know of any applications (mine test util not counting :-) that
> > use KDSKBMODE/KDSETLED/KDSKBSTATE, then we should probably fix
> > the kernel callers.
> 
> XFree86/Xorg use KDSKBMODE and KDSETLED, see f.e. the Xorg
> "kbd" driver:
> http://webcvs.freedesktop.org/xorg/xserver/xorg/hw/xfree86/os-support/bsd/bsd_kbd.c?revision=1.8&view=markup
> 
Hmm, but they don't work on sparc64.  How X.Org ever works then?
I remember installing it on my sparc64 laptop...

: # uname -p
: sparc64
: # cat a.c
: #include <sys/kbio.h>
: #include <sys/ioctl.h>
: #include <err.h>
: #include <stdio.h>
: #include <stdlib.h>
: 
: int
: main(void)
: {
:         int mode;
: 
:         mode = K_CODE;
:         if (ioctl(0, KDSKBMODE, mode) == -1)
:                 err(1, "ioctl(KDSKBMODE)");
: 
:         if (ioctl(0, KDGKBMODE, &mode) == -1)
:                 err(1, "ioctl(KDGKBMODE)");
:         printf("current mode = %d, should be %d\n", mode, K_CODE);
: 
:         exit (0);
: }
: # ./a < /dev/vkbdctl0
: current mode = 0, should be 2
: # 


Cheers,
-- 
Ruslan Ermilov
ru_at_FreeBSD.org
FreeBSD committer

Received on Wed Sep 20 2006 - 05:57:16 UTC