Author ngie
Recipients asvetlov, gregory.p.smith, loewis, ngie, serhiy.storchaka, trent
Date 2015-02-15.09:57:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1423994266.33.0.0720285565896.issue16124@psf.upfronthosting.co.za>
In-reply-to
Content
Yes, it's a duplicate. That being said, documentation alone it should be unsigned long for Darwin (OS/X), FreeBSD, OpenBSD. Looking at the definition for ioctl(2), the below example would cause a failure.

I need to hunt around for a practical example as I don't have one offhand (it's something that was found a long time ago in a couple of python 2.6 at my current employer because they have ioctl's that go beyond the 32-bit boundary IIRC...)

fuji:~ ngie$ clang -Wall -c test_ioctl.c
fuji:~ ngie$ clang -DBROKEN -Wall -c test_ioctl.c
test_ioctl.c:9:9: warning: incompatible pointer types initializing 'ioctl_t'
      (aka 'int (*)(int, int, ...)') with an expression of type 'int (int,
      unsigned long, ...)' [-Wincompatible-pointer-types]
ioctl_t _ioctl = ioctl;
        ^        ~~~~~
1 warning generated.
fuji:~ ngie$ cat test_ioctl.c 
#include <sys/ioctl.h>

#ifdef BROKEN
typedef int (*ioctl_t)(int, int, ...);
#else
typedef int (*ioctl_t)(int, unsigned long, ...);
#endif

ioctl_t _ioctl = ioctl;
fuji:~ ngie$ uname -a
Darwin fuji.local 13.4.0 Darwin Kernel Version 13.4.0: Wed Dec 17 19:05:52 PST 2014; root:xnu-2422.115.10~1/RELEASE_X86_64 x86_64
History
Date User Action Args
2015-02-15 09:57:46ngiesetrecipients: + ngie, loewis, gregory.p.smith, trent, asvetlov, serhiy.storchaka
2015-02-15 09:57:46ngiesetmessageid: <1423994266.33.0.0720285565896.issue16124@psf.upfronthosting.co.za>
2015-02-15 09:57:46ngielinkissue16124 messages
2015-02-15 09:57:45ngiecreate