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

Ruslan Ermilov ru at freebsd.org
Tue Sep 19 22:57:16 PDT 2006


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/cvs-src/attachments/20060920/fc663dc0/attachment.pgp


More information about the cvs-src mailing list