2012-07-23 Carlos O'Donell * include/sys/ioctl.h: Use `int' for __request argument of function __ioctl. * misc/ioctl.c (__ioctl): Likewise. * misc/sys/ioctl.h: Likewise. * sysdeps/mach/hurd/ioctl.c (__ioctl): Likewise. * sysdeps/unix/sysv/linux/powerpc/ioctl.c (__ioctl): Likewise. * ports/sysdeps/unix/sysv/linux/mips/mips64/n64/ioctl.S: Add FIXME. * ports/sysdeps/unix/sysv/linux/tile/tilegx/ioctl.S: Add FIXME. diff --git a/include/sys/ioctl.h b/include/sys/ioctl.h index ebadd52..883c12e 100644 --- a/include/sys/ioctl.h +++ b/include/sys/ioctl.h @@ -2,5 +2,5 @@ #include /* Now define the internal interfaces. */ -extern int __ioctl (int __fd, unsigned long int __request, ...); +extern int __ioctl (int __fd, int __request, ...); #endif diff --git a/misc/ioctl.c b/misc/ioctl.c index 616ee2d..a5d4a81 100644 --- a/misc/ioctl.c +++ b/misc/ioctl.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 93, 94, 95, 96, 97 Free Software Foundation, Inc. +/* Copyright (C) 1991-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -23,7 +23,7 @@ int __ioctl (fd, request) int fd; - unsigned long int request; + int request; { __set_errno (ENOSYS); return -1; diff --git a/misc/sys/ioctl.h b/misc/sys/ioctl.h index c49c4ab..8340a0a 100644 --- a/misc/sys/ioctl.h +++ b/misc/sys/ioctl.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 92, 93, 94, 96, 98, 99 Free Software Foundation, Inc. +/* Copyright (C) 1991-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -38,7 +38,7 @@ __BEGIN_DECLS /* Perform the I/O control operation specified by REQUEST on FD. One argument may follow; its presence and type depend on REQUEST. Return value depends on REQUEST. Usually -1 indicates error. */ -extern int ioctl (int __fd, unsigned long int __request, ...) __THROW; +extern int ioctl (int __fd, int __request, ...) __THROW; __END_DECLS diff --git a/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/ioctl.S b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/ioctl.S index 3ff0d0e..1cb3541 100644 --- a/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/ioctl.S +++ b/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/ioctl.S @@ -1,4 +1,4 @@ -/* Copyright 2003, 2005 Free Software Foundation, Inc. +/* Copyright 2003-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -19,6 +19,9 @@ #include +/* FIXME: Now that the userspace API claims that the argument + if of type `int' does this code need updating? */ + /* Sign-extend the ioctl number, since the kernel wants it as a sign-extended 32-bit value, but our prototype is that of a long. */ diff --git a/ports/sysdeps/unix/sysv/linux/tile/tilegx/ioctl.S b/ports/sysdeps/unix/sysv/linux/tile/tilegx/ioctl.S index e966c4d..b61592c 100644 --- a/ports/sysdeps/unix/sysv/linux/tile/tilegx/ioctl.S +++ b/ports/sysdeps/unix/sysv/linux/tile/tilegx/ioctl.S @@ -1,4 +1,4 @@ -/* Copyright (C) 2011 Free Software Foundation, Inc. +/* Copyright (C) 2011-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Chris Metcalf , 2011. @@ -16,6 +16,8 @@ License along with the GNU C Library. If not, see . */ +/* FIXME: Now that the userspace API claims that the argument + if of type `int' does this code need updating? */ /* TILE-Gx specifies that "unsigned int" is sign extended in the high 32 bits. But since the userspace API claims to be "unsigned long", diff --git a/sysdeps/mach/hurd/ioctl.c b/sysdeps/mach/hurd/ioctl.c index 543d437..6aeeca4 100644 --- a/sysdeps/mach/hurd/ioctl.c +++ b/sysdeps/mach/hurd/ioctl.c @@ -36,7 +36,7 @@ /* Perform the I/O control operation specified by REQUEST on FD. The actual type and use of ARG and the return value depend on REQUEST. */ int -__ioctl (int fd, unsigned long int request, ...) +__ioctl (int fd, int request, ...) { #ifdef MACH_MSG_TYPE_CHAR /* Map individual type fields to Mach IPC types. */ diff --git a/sysdeps/unix/sysv/linux/powerpc/ioctl.c b/sysdeps/unix/sysv/linux/powerpc/ioctl.c index e8f5d16..b470ae8 100644 --- a/sysdeps/unix/sysv/linux/powerpc/ioctl.c +++ b/sysdeps/unix/sysv/linux/powerpc/ioctl.c @@ -25,7 +25,7 @@ using the new-style struct termios, and translate them to old-style. */ int -__ioctl (int fd, unsigned long int request, ...) +__ioctl (int fd, int request, ...) { void *arg; va_list ap;