pkg-config libdivecomputer / subsurface makefile / confusion

Jef Driesen jefdriesen at telenet.be
Tue Jul 10 23:19:55 PDT 2012


On 2012-07-11 05:01, Linus Torvalds wrote:
> On Tue, Jul 10, 2012 at 4:17 PM, Grischa Toedt <toedt at embl.de> wrote:
>>
>> "On Mac OS X (and probably the other BSD's too), the ioctl() syscall
>> takes an 'unsigned long' integer as the request parameter.
>
> And that's complete bullshit. The Open Group (aka "Unix") is pretty
> damn clear. The request parameter is an "int", and OS X is buggy.
>
> See for example
>
>    http://pubs.opengroup.org/onlinepubs/7908799/xsh/ioctl.html
>
> Ugh. I remember the pain we had with OS X when doing git too.
> Performance problems, non-standard crap. Most of it was Mach being
> slow, but the ioctl buggery seems to come from the FreeBSD roots..

The Open Group specification clearly document the request parameter as 
an "int", but the Mac OS X pages say "unsigned long":

https://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man2/ioctl.2.html

Whether that's right or wrong, we'll just have to live with it.

On my linux system, the manpages contain a function prototype that 
matches the Open Group specification:

int ioctl(int d, int request, ...);

But the function prototype in the <sys/ioctl.h> header also has an 
"unsigned long" parameter:

extern int ioctl (int __fd, unsigned long int __request, ...) __THROW;

Jef


More information about the subsurface mailing list