From: Wichert Akkerman Date: Fri, 3 Aug 2001 21:49:34 +0000 (+0000) Subject: change regexps so we catch sound ioctls as well in Linux X-Git-Tag: v4.5.18~1022 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b50c90745809da023afe793f9ce19f39d5ca88ce;p=strace change regexps so we catch sound ioctls as well in Linux --- diff --git a/linux/ioctlent.sh b/linux/ioctlent.sh index 1fadff1c..fb37ae53 100644 --- a/linux/ioctlent.sh +++ b/linux/ioctlent.sh @@ -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"