]> granicus.if.org Git - strace/commitdiff
2004-05-02 Dmitry V. Levin <ldv@altlinux.org>
authorRoland McGrath <roland@redhat.com>
Fri, 4 Jun 2004 02:03:06 +0000 (02:03 +0000)
committerRoland McGrath <roland@redhat.com>
Fri, 4 Jun 2004 02:03:06 +0000 (02:03 +0000)
* linux/ioctlent.sh: Build the list of ioctls defined in
linux/fb.h (0x46..), linux/kd.h (0x4B..), linux/cdrom.h (0x53..),
asm/ioctls.h (0x54..), linux/vt.h (0x56..), linux/videotext.h
(0x71..), linux/videotext.h (0x72..), asm/sockios.h (0x89..),
linux/sockios.h (0x89..), linux/wireless.h (0x8B..).

linux/ioctlent.sh

index 9bc0a335d8d12fef0cad3618a445b5703db6ceb7..bba609725036e445bd32d6a4188331147c8dd2b3 100644 (file)
@@ -37,12 +37,27 @@ fi
 
 dir=$1
 
-files="asm/ioctls.h /dev/null"
-# Build the list of all ioctls
-regexp='^[[:space:]]*#[[:space:]]*define[[:space:]]\+[A-Z][A-Z0-9_]*[[:space:]]\+0x54..\>'
-(cd $dir ; grep $regexp $files 2>/dev/null ) | \
-       sed -ne 's/^\(.*\):[[:space:]]*#[[:space:]]*define[[:space:]]*\([A-Z0-9_]*\)[[:space:]]*\(0x54..\).*/   { "\1", "\2",   \3      },/p' \
-       > ioctls.h
+lookup_ioctls()
+{
+       type="$1"
+       shift
+
+       # Build the list of all ioctls
+       regexp='^[[:space:]]*#[[:space:]]*define[[:space:]]\+[A-Z][A-Z0-9_]*[[:space:]]\+0x'"$type"'..\>'
+       (cd "$dir" ; grep "$regexp" "$@" /dev/null 2>/dev/null ) |
+               sed -ne 's/^\(.*\):[[:space:]]*#[[:space:]]*define[[:space:]]*\([A-Z0-9_]*\)[[:space:]]*\(0x'"$type"'..\).*/    { "\1", "\2",   \3      },/p' \
+               >> ioctls.h
+}
+
+: > ioctls.h
+lookup_ioctls 46 linux/fb.h
+lookup_ioctls 4B linux/kd.h
+lookup_ioctls 53 linux/cdrom.h
+lookup_ioctls 54 asm/ioctls.h
+lookup_ioctls 56 linux/vt.h
+lookup_ioctls '7[12]' linux/videotext.h
+lookup_ioctls 89 asm/sockios.h linux/sockios.h
+lookup_ioctls 8B linux/wireless.h
 
 files="linux/* asm/* scsi/* sound/*"