This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: Intercept ioctls
- From: Ãngel GonzÃlez <keisial at gmail dot com>
- To: Andreas Ames <Andreas dot Ames at gmx dot de>
- Cc: libc-help at sourceware dot org
- Date: Mon, 13 May 2013 13:30:01 +0200
- Subject: Re: Intercept ioctls
- References: <trinity-3b49b9e9-5789-4b39-a758-bc16eeac25f5-1368443267742 at 3capp-gmx-bs18>
On 13/05/13 13:07, Andreas Ames wrote:
> My questions are:
>
> 1. Is my above guesswork reasonable?
>
> 2. Are there other argument types that are more dangerous (like one-byte, two-byte etc. arguments)?
>
> 3. Do you know a better approach to shim ioctls?
>
>
> Thanks in advance,
>
> aa
Yes, it should work. You may be passing a garbage argument to the , but
in that case, due to the request code, the real ioctl won't be using it.
Given that sizeof(void*) >= sizeof(int), your choice seems appropiate:
> The arg argument represents additional information that is
> needed by this specific STREAMS device to perform
> the requested function. The type of arg depends upon the
> particular control request, but it shall be either an
> integer or a pointer to a device-specific data structure.