[PATCH] linux/ioctlent.sh: handle multiple defines per-ioctl

Mike Frysinger vapier at gentoo.org
Fri Feb 20 17:38:50 UTC 2009


On Friday 20 February 2009 12:04:20 Denys Vlasenko wrote:
> On Fri, 2009-02-13 at 17:30 -0500, Mike Frysinger wrote:
> > On Wednesday 26 March 2008 19:08:59 Mike Frysinger wrote:
> > > The current sed statement works fine if the ioctl definition only
> > > utilizes one define in it.  If it uses two, things fall apart.  Such is
> > > the case with linux/dm-ioctl.h:
> > > _IOC(_IOC_NONE,DM_IOCTL,DM_LIST_DEVICES_CMD,....)
> > > Only the last define (DM_LIST_DEVICES_CMD) gets extracted.  This tweaks
> > > the sed to handle the two-define case.
> > >
> > > I also fixed uniq/sort as doing `... | uniq | sort` wont work, you need
> > > to reverse the steps for uniq to actually work.
> >
> > any chance of getting this merged ?
>
> Which kernel has that? (linux-2.6.28.6 doesn't)

the verbatim form i mentioned isnt, but every kernel version with dm-ioctl.h 
has this issue.

if you run the current ioctlent.sh script:
linux_git=/usr/local/src/linux/linux-2.6x
sh ./linux/ioctlent.sh $linux_git/include $linux_git/arch/x86/include/asm

we end up with ioctls.h with lines like:
{
	"linux/dm-ioctl.h",
	"DM_VERSION",
	_IOC(_IOC_NONE,DM_IOCTL,DM_VERSION_CMD,0)
},

which results in the errors:
./ioctls.h:489: error: ‘DM_IOCTL’ undeclared here (not in a function)
./ioctls.h:489: error: ‘DM_VERSION_CMD’ undeclared here (not in a function)
... bunch more ...

it looks like since i posted this patch, ive accumulated more fixes in the 
Blackfin tree, so i'll start a small patch series
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 835 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20090220/1b315829/attachment.bin>


More information about the Strace-devel mailing list