[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ioctl-patch for Darwin and FreeBSD
From: |
Eric Blake |
Subject: |
Re: ioctl-patch for Darwin and FreeBSD |
Date: |
Tue, 22 Feb 2011 13:03:10 -0700 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Fedora/3.1.7-0.35.b3pre.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.7 |
On 02/22/2011 12:34 PM, Markus Gothe wrote:
> Please see attached patch for ioctl() on FreeBSD and Darwin. Their definition
> differ from (int, int, ...) and the gnulib variant doesn't work well on
> 64-bit Darwin with this proto.
Can you please convince your mailer to send patches with MIME type
text/plain, rather than encoded as application/octet-stream?
> --- lib/ioctl.c.old 2011-02-22 20:21:11.000000000 +0100
> +++ lib/ioctl.c 2011-02-22 20:24:38.000000000 +0100
> @@ -28,7 +28,11 @@
> /* Provide a wrapper with the POSIX prototype. */
> # undef ioctl
> int
> +#if __FreeBSD__ || __Darwin__
> +rpl_ioctl (int fd, unsigned long request, ... /* {void *,char *} arg */)
> +#else
> rpl_ioctl (int fd, int request, ... /* {void *,char *} arg */)
> +#endif
This part is wrong - the replacement should ALWAYS match the POSIX
signature, and the type munging take place within the replacement,
rather than declaring the replacement with the wrong type.
> +++ m4/ioctl.m4 2011-02-22 20:26:10.000000000 +0100
> @@ -24,7 +24,13 @@
> [AC_COMPILE_IFELSE(
> [AC_LANG_PROGRAM(
> [[#include <sys/ioctl.h>]],
> - [[extern int ioctl (int, int, ...);]])
> + [[
> + #if __FreeBSD__ || __Darwin__
> + extern int ioctl (int, unsigned long, ...);
> + #else
> + extern int ioctl (int, int, ...);
> + #endif
> + ]])
> ],
> [gl_cv_func_ioctl_posix_signature=yes],
> [gl_cv_func_ioctl_posix_signature=no])
This is wrong as well - the whole point of this test is to reject the
FreeBSD/Darwin ioctl signature as non-compliant, so that the rest of the
code will provide a correct signature wrapper in the form of rpl_ioctl.
What is the exact failure you are seeing, and on which project?
--
Eric Blake address@hidden +1-801-349-2682
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature