Port-sparc64 archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: ioctl question



David Laight <david%l8s.co.uk@localhost> writes:

> It all tends to work because the int parameters get implicitly extended
> to long because the first 6 parameters are passed in registers.
>
> However the defintiion for ioctl() is currently:
>     int ioctl(int, int, ...)
> This is portable since the '...' arg is usually a pointer, but could be
> an int (or long) but the calling convention is assumed to be that for
> 'void *'.  With that definition the libc stub should hav code to deternime
> what the arg type is (dependant on the ioct code and driver) and use va_arg()
> to collect the correct value!

On NetBSD-4/i386, man 2 ioctl says:

SYNOPSIS
     #include <sys/ioctl.h>

     int
     ioctl(int d, unsigned long request, void *argp);

and in sys/ioctl.h:

__BEGIN_DECLS
int     ioctl(int, unsigned long, ...);
__END_DECLS


Home | Main Index | Thread Index | Old Index