ioctl_return and ioctl handler type

Sebastian Huber sebastian.huber at embedded-brains.de
Tue Apr 3 13:35:32 UTC 2012


On 04/03/2012 03:11 PM, Ralf Corsepius wrote:
> On 04/03/2012 01:44 PM, Joel Sherrill wrote:
>> Tradition?
>>
>> There was a heavy use of unsigned 32 bit integers and as we have moved more
>> and more to POSIX, some are left.
>>
>> This makes sense to change but the ripple will be tedious.
>
>>> int devFS_ioctl(
>>> rtems_libio_t *iop,
>>> uint32_t command,
>>> void *buffer
>
> While we're at it, all ioctl's are supposed to take an ioctl_command_t as
> command argument.

Currently we have this:

typedef int (*rtems_filesystem_ioctl_t)(
   rtems_libio_t *iop,
   uint32_t       request,
   void          *buffer
);

And:

int ioctl(
   int  fd,
   ioctl_command_t  command,
   ...
)
{
   va_list            ap;
   int                rc;
   rtems_libio_t     *iop;
   void              *buffer;

   rtems_libio_check_fd( fd );
   iop = rtems_libio_iop( fd );
   rtems_libio_check_is_open(iop);

   va_start(ap, command);

   buffer = va_arg(ap, void *);

   /*
    *  Now process the ioctl().
    */
   rc = (*iop->pathinfo.handlers->ioctl_h)( iop, command, buffer );

   va_end( ap );
   return rc;
}

We should change this to:

typedef int (*rtems_filesystem_ioctl_t)(
   rtems_libio_t *iop,
   ioctl_command_t request,
   va_list ap
);

-- 
Sebastian Huber, embedded brains GmbH

Address : Obere Lagerstr. 30, D-82178 Puchheim, Germany
Phone   : +49 89 18 90 80 79-6
Fax     : +49 89 18 90 80 79-9
E-Mail  : sebastian.huber at embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.



More information about the devel mailing list