Date: Sat, 13 May 2000 06:31:10 -0400 From: Tim Vanderhoek <vanderh@ecf.utoronto.ca> To: Alex Kosorukoff <alex@3form.com> Cc: freebsd-stable@FreeBSD.org Subject: Re: Console ioctl in FBSD Message-ID: <20000513063110.A8456@mad> In-Reply-To: <391CD124.C8EAAEBD@3form.com>; from Alex Kosorukoff on Fri, May 12, 2000 at 10:51:00PM -0500 References: <391CD124.C8EAAEBD@3form.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, May 12, 2000 at 10:51:00PM -0500, Alex Kosorukoff wrote:
>
> I try to control keyboard LEDs with ioctl calls but they don't work.
> Despite ioctl returns success, LEDs will not turn on/off. The same code
FWIW, it worked for me on ~3.4-R.
> works fine on Linux (with a change of <machine/console.h> to
> <linux/kd.h>. Is it a bug or feature of FBSD? How to make it work?
>
> The code is following:
>
> #include <stdio.h>
> #include <stdlib.h>
> #include <fcntl.h>
> #include <sys/ioctl.h>
> #include <machine/console.h>
>
> main(int argc, char *argv[]) {
> char leds;
>
> if ( ioctl( 0, KDGETLED, &leds ) ) {
> fprintf(stderr,"Can't get leds\n");
> exit(1);
> }
> if ( ioctl( 0, KDSETLED, leds | LED_CAP ) ) {
> fprintf(stderr,"Can't set leds\n");
> exit(1);
> }
> printf("Caps lock should glow\n");
> getchar();
> ioctl( 0, KDSETLED, leds );
> exit(0);
> }
>
> Sincerely,
> Alex
>
>
>
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-stable" in the body of the message
--
Signature withheld by request of author.
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000513063110.A8456>
