]> granicus.if.org Git - strace/commitdiff
change regexps so we catch sound ioctls as well in Linux
authorWichert Akkerman <wichert@deephackmode.org>
Fri, 3 Aug 2001 21:49:34 +0000 (21:49 +0000)
committerWichert Akkerman <wichert@deephackmode.org>
Fri, 3 Aug 2001 21:49:34 +0000 (21:49 +0000)
linux/ioctlent.sh

index 1fadff1cec84f296825fb669cbd6fc73445be6fe..fb37ae539a3eb100d85f5c5cd15fab952e9564e7 100644 (file)
@@ -1,18 +1,18 @@
 #! /bin/sh
 
-dir="/tmp/include"
+dir="/usr/include"
 files="linux/* asm/* scsi/*"
 
 # Build the list of all ioctls
-regexp='^[[:space:]]*#[[:space:]]*define[[:space:]]\+[A-Z][A-Z0-9_]*[[:space:]]\+_\(IO\|IOW\|IOR\|IOWR\)\>'
+regexp='^[[:space:]]*#[[:space:]]*define[[:space:]]\+[A-Z][A-Z0-9_]*[[:space:]]\+_S\?\(IO\|IOW\|IOR\|IOWR\)\>'
 (cd $dir ; grep $regexp $files 2>/dev/null ) | \
-       sed -ne 's/^\(.*\):[[:space:]]*#[[:space:]]*define[[:space:]]*\([A-Z0-9_]*\)[[:space:]]*_I.*(\([^[,]*\),\([^,)]*\).*/   { "\1", "\2",   _IOC(_IOC_NONE,\3,\4,0) },/p' \
+       sed -ne 's/^\(.*\):[[:space:]]*#[[:space:]]*define[[:space:]]*\([A-Z0-9_]*\)[[:space:]]*_S\?I.*(\([^[,]*\)[[:space:]]*,[[:space:]]*\([^,)]*\).*/        { "\1", "\2",   _IOC(_IOC_NONE,\3,\4,0) },/p' \
        > ioctls.h
 
 # Some use a special base to offset their ioctls on. Extract that as well.
 : > ioctldefs.h
 
-bases=$(sed -ne 's/.*_IOC_NONE,\([A-Z][A-Z0-9_]\+\),.*/\1/p' ioctls.h | uniq | sort)
+bases=$(sed -ne 's/.*_IOC_NONE.*,[[:space:]]*\([A-Z][A-Z0-9_]\+\)[[:space:]+,].*/\1/p' ioctls.h | uniq | sort)
 for base in $bases ; do
        echo "Looking for $base"
        regexp="^[[:space:]]*#[[:space:]]*define[[:space:]]\+$base"