aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Kerrisk <mtk.manpages@gmail.com>2016-07-16 12:32:19 +0200
committerMichael Kerrisk <mtk.manpages@gmail.com>2016-07-16 12:32:19 +0200
commit40c7eed4ef788d2184f74f35254e3fb2542342b5 (patch)
treece8d7fb951317787fbb5b1522acff8a15830bf95
parente4fcb7bcc361b8d6a40f88503634f4a53ab8dc9e (diff)
downloadman-pages-40c7eed4ef788d2184f74f35254e3fb2542342b5.tar.gz
console_ioctl.4: The argument to KDGETMODE is an 'int'
As reported by Chris:i The manual entry for KDGETMODE specifies "argp points to a long which is set to one of the above values." At least on x86_64-bit Fedora24, the text should probably specify argp is an int (32-bit), rather than a long (64-bit). [To verify:] Open a file descriptor to the local console, and execute some code like the following: long arg = -1; if (-1 == ioctl(fd, KDGETMODE, &arg)) { return -1; } printf("KDGETMODE: 0x%lx\n", arg); Now try this version: int arg = -1; if (-1 == ioctl(fd, KDGETMODE, &arg)) { return -1; } printf("KDGETMODE: 0x%x\n", arg); Result: The first version gives this result: KDGETMODE: 0xffffffff00000001 The second version gives this result: KDGETMODE: 0x1 Reading the kernel source confirms this point. Reported-by: Chris Gassib <position0x45@hotmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
-rw-r--r--man4/console_ioctl.44
1 files changed, 2 insertions, 2 deletions
diff --git a/man4/console_ioctl.4 b/man4/console_ioctl.4
index ee7d926a57..4a44e44b6c 100644
--- a/man4/console_ioctl.4
+++ b/man4/console_ioctl.4
@@ -133,8 +133,8 @@ KD_GRAPHICS 0x01
.B KDGETMODE
Get text/graphics mode.
.I argp
-points to a
-.I long
+points to an
+.I int
which is set to one
of the above values.
.TP