Package: manpages Severity: normal
This description: > KDGETLED > Get state of LEDs. argp points to a long. The lower three bits > of *argp are set to the state of the LEDs, as follows: > > LED_CAP 0x04 caps lock led > LEC_NUM 0x02 num lock led > LED_SCR 0x01 scroll lock led is wrong. The kernel only stores a single byte *argp, so if you give it the address of a long, you won't necessarily find the results in the low 3 bits of the long. (It happens to work out that way if you are little-endian.) Change "long" to "char" and the description will be correct. Demonstration program (run it on a big-endian machine to see that the actual behavior is not what the man page says): #include <stdio.h> #include <sys/ioctl.h> #include <linux/kd.h> int main(void) { int ioctlret; long longval; longval = -1; ioctlret = ioctl(0, KDGETLED, &longval); printf("ioctlret=%d longval=%08lx\n", ioctlret, longval); return 0; } -- System Information: Debian Release: 5.0 APT prefers stable APT policy: (99, 'stable') Architecture: powerpc (ppc) Kernel: Linux 2.6.28.2 Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968) Shell: /bin/sh linked to /bin/dash manpages depends on no packages. manpages recommends no packages. Versions of packages manpages suggests: ii man-db [man-browser] 2.5.2-4 on-line manual pager -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org