This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [WIP] BZ #14361: POSIX vs. BSD and the `ioctl' interface.


On 7/23/2012 11:55 PM, Carlos O'Donell wrote:
> Roland,
>
> In 1993 you changed ioctl's second argument to be `unsigned long int' to
> match BSD 4.4. [...]
> Just to frame the discussion I wrote up a WIP patch and included some 
> FIXME's for Tilera and MIPS which expect certain behaviour from our 
> ioctl interface
> [...]
> --- 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 <cmetcalf@tilera.com>, 2011.
>  
> @@ -16,6 +16,8 @@
>     License along with the GNU C Library.  If not, see
>     <http://www.gnu.org/licenses/>.  */
>  
> +/* FIXME: Now that the userspace API claims that the argument
> +          if of type `int' does this code need updating?  */

The existing glibc code for tile is a "belt and suspenders" fix for older
tile kernels.  HAVE_SYSCALL_WRAPPERS was only enabled for tilegx by default
in Linux 3.4, so for any older kernel, the ioctl() code in glibc avoids
confusing the kernel.

Certainly if we changed the userspace API to "int", we could remove the
special ioctl.S file for tilegx, since we'd only get properly sign-extended
values passed into __ioctl() in that case.

-- 
Chris Metcalf, Tilera Corp.
http://www.tilera.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]