[PATCH] ioctlsort: zero pad to 4 places

Mike Frysinger vapier at gentoo.org
Tue Feb 22 04:52:42 UTC 2011


Zero padding the ioctl number will allow simple sorting via shell scripts.

Signed-off-by: Mike Frysinger <vapier at gentoo.org>
---
 linux/ioctlent.h  |  170 ++++++++++++++++++++++++++--------------------------
 linux/ioctlsort.c |    2 +-
 2 files changed, 86 insertions(+), 86 deletions(-)

diff --git a/linux/ioctlent.h b/linux/ioctlent.h
index cc5af72..8cba446 100644
--- a/linux/ioctlent.h
+++ b/linux/ioctlent.h
@@ -1,89 +1,89 @@
 	/* Generated by ioctlsort */
-	{"linux/fs.h",	"FIBMAP",	0x1},
-	{"linux/fs.h",	"FIGETBSZ",	0x2},
-	{"linux/fd.h",	"FDGETPRM",	0x204},
-	{"linux/fd.h",	"FDGETMAXERRS",	0x20e},
-	{"linux/fd.h",	"FDGETDRVTYP",	0x20f},
-	{"linux/fd.h",	"FDGETDRVPRM",	0x211},
-	{"linux/fd.h",	"FDGETDRVSTAT",	0x212},
-	{"linux/fd.h",	"FDPOLLDRVSTAT",	0x213},
-	{"linux/fd.h",	"FDGETFDCSTAT",	0x215},
-	{"linux/fd.h",	"FDWERRORGET",	0x217},
-	{"linux/fd.h",	"FDCLRPRM",	0x241},
-	{"linux/fd.h",	"FDSETPRM",	0x242},
-	{"linux/fd.h",	"FDDEFPRM",	0x243},
-	{"linux/fd.h",	"FDMSGON",	0x245},
-	{"linux/fd.h",	"FDMSGOFF",	0x246},
-	{"linux/fd.h",	"FDFMTBEG",	0x247},
-	{"linux/fd.h",	"FDFMTTRK",	0x248},
-	{"linux/fd.h",	"FDFMTEND",	0x249},
-	{"linux/fd.h",	"FDSETEMSGTRESH",	0x24a},
-	{"linux/fd.h",	"FDFLUSH",	0x24b},
-	{"linux/fd.h",	"FDSETMAXERRS",	0x24c},
-	{"linux/fd.h",	"FDRESET",	0x254},
-	{"linux/fd.h",	"FDWERRORCLR",	0x256},
-	{"linux/fd.h",	"FDRAWCMD",	0x258},
-	{"linux/fd.h",	"FDTWADDLE",	0x259},
-	{"linux/fd.h",	"FDEJECT",	0x25a},
-	{"linux/fd.h",	"FDSETDRVPRM",	0x290},
-	{"linux/hdreg.h",	"HDIO_GETGEO",	0x301},
-	{"linux/hdreg.h",	"HDIO_GET_UNMASKINTR",	0x302},
-	{"linux/hdreg.h",	"HDIO_GET_MULTCOUNT",	0x304},
-	{"linux/hdreg.h",	"HDIO_GET_QDMA",	0x305},
-	{"linux/hdreg.h",	"HDIO_SET_XFER",	0x306},
-	{"linux/hdreg.h",	"HDIO_OBSOLETE_IDENTITY",	0x307},
-	{"linux/hdreg.h",	"HDIO_GET_KEEPSETTINGS",	0x308},
-	{"linux/hdreg.h",	"HDIO_GET_32BIT",	0x309},
-	{"linux/hdreg.h",	"HDIO_GET_NOWERR",	0x30a},
-	{"linux/hdreg.h",	"HDIO_GET_DMA",	0x30b},
-	{"linux/hdreg.h",	"HDIO_GET_NICE",	0x30c},
-	{"linux/hdreg.h",	"HDIO_GET_IDENTITY",	0x30d},
-	{"linux/hdreg.h",	"HDIO_GET_WCACHE",	0x30e},
-	{"linux/hdreg.h",	"HDIO_GET_ACOUSTIC",	0x30f},
-	{"linux/hdreg.h",	"HDIO_GET_ADDRESS",	0x310},
-	{"linux/hdreg.h",	"HDIO_GET_BUSSTATE",	0x31a},
-	{"linux/hdreg.h",	"HDIO_TRISTATE_HWIF",	0x31b},
-	{"linux/hdreg.h",	"HDIO_DRIVE_RESET",	0x31c},
-	{"linux/hdreg.h",	"HDIO_DRIVE_TASKFILE",	0x31d},
-	{"linux/hdreg.h",	"HDIO_DRIVE_TASK",	0x31e},
-	{"linux/hdreg.h",	"HDIO_DRIVE_CMD",	0x31f},
-	{"linux/hdreg.h",	"HDIO_SET_MULTCOUNT",	0x321},
-	{"linux/hdreg.h",	"HDIO_SET_UNMASKINTR",	0x322},
-	{"linux/hdreg.h",	"HDIO_SET_KEEPSETTINGS",	0x323},
-	{"linux/hdreg.h",	"HDIO_SET_32BIT",	0x324},
-	{"linux/hdreg.h",	"HDIO_SET_NOWERR",	0x325},
-	{"linux/hdreg.h",	"HDIO_SET_DMA",	0x326},
-	{"linux/hdreg.h",	"HDIO_SET_PIO_MODE",	0x327},
-	{"linux/hdreg.h",	"HDIO_SCAN_HWIF",	0x328},
-	{"linux/hdreg.h",	"HDIO_SET_NICE",	0x329},
-	{"linux/hdreg.h",	"HDIO_UNREGISTER_HWIF",	0x32a},
-	{"linux/hdreg.h",	"HDIO_SET_WCACHE",	0x32b},
-	{"linux/hdreg.h",	"HDIO_SET_ACOUSTIC",	0x32c},
-	{"linux/hdreg.h",	"HDIO_SET_BUSSTATE",	0x32d},
-	{"linux/hdreg.h",	"HDIO_SET_QDMA",	0x32e},
-	{"linux/hdreg.h",	"HDIO_SET_ADDRESS",	0x32f},
-	{"linux/raid/md_u.h",	"RAID_VERSION",	0x910},
-	{"linux/raid/md_u.h",	"GET_ARRAY_INFO",	0x911},
-	{"linux/raid/md_u.h",	"GET_DISK_INFO",	0x912},
-	{"linux/raid/md_u.h",	"PRINT_RAID_DEBUG",	0x913},
-	{"linux/raid/md_u.h",	"RAID_AUTORUN",	0x914},
-	{"linux/raid/md_u.h",	"GET_BITMAP_FILE",	0x915},
-	{"linux/raid/md_u.h",	"CLEAR_ARRAY",	0x920},
-	{"linux/raid/md_u.h",	"ADD_NEW_DISK",	0x921},
-	{"linux/raid/md_u.h",	"HOT_REMOVE_DISK",	0x922},
-	{"linux/raid/md_u.h",	"SET_ARRAY_INFO",	0x923},
-	{"linux/raid/md_u.h",	"SET_DISK_INFO",	0x924},
-	{"linux/raid/md_u.h",	"WRITE_RAID_INFO",	0x925},
-	{"linux/raid/md_u.h",	"UNPROTECT_ARRAY",	0x926},
-	{"linux/raid/md_u.h",	"PROTECT_ARRAY",	0x927},
-	{"linux/raid/md_u.h",	"HOT_ADD_DISK",	0x928},
-	{"linux/raid/md_u.h",	"SET_DISK_FAULTY",	0x929},
-	{"linux/raid/md_u.h",	"HOT_GENERATE_ERROR",	0x92a},
-	{"linux/raid/md_u.h",	"SET_BITMAP_FILE",	0x92b},
-	{"linux/raid/md_u.h",	"RUN_ARRAY",	0x930},
-	{"linux/raid/md_u.h",	"STOP_ARRAY",	0x932},
-	{"linux/raid/md_u.h",	"STOP_ARRAY_RO",	0x933},
-	{"linux/raid/md_u.h",	"RESTART_ARRAY_RW",	0x934},
+	{"linux/fs.h",	"FIBMAP",	0x0001},
+	{"linux/fs.h",	"FIGETBSZ",	0x0002},
+	{"linux/fd.h",	"FDGETPRM",	0x0204},
+	{"linux/fd.h",	"FDGETMAXERRS",	0x020e},
+	{"linux/fd.h",	"FDGETDRVTYP",	0x020f},
+	{"linux/fd.h",	"FDGETDRVPRM",	0x0211},
+	{"linux/fd.h",	"FDGETDRVSTAT",	0x0212},
+	{"linux/fd.h",	"FDPOLLDRVSTAT",	0x0213},
+	{"linux/fd.h",	"FDGETFDCSTAT",	0x0215},
+	{"linux/fd.h",	"FDWERRORGET",	0x0217},
+	{"linux/fd.h",	"FDCLRPRM",	0x0241},
+	{"linux/fd.h",	"FDSETPRM",	0x0242},
+	{"linux/fd.h",	"FDDEFPRM",	0x0243},
+	{"linux/fd.h",	"FDMSGON",	0x0245},
+	{"linux/fd.h",	"FDMSGOFF",	0x0246},
+	{"linux/fd.h",	"FDFMTBEG",	0x0247},
+	{"linux/fd.h",	"FDFMTTRK",	0x0248},
+	{"linux/fd.h",	"FDFMTEND",	0x0249},
+	{"linux/fd.h",	"FDSETEMSGTRESH",	0x024a},
+	{"linux/fd.h",	"FDFLUSH",	0x024b},
+	{"linux/fd.h",	"FDSETMAXERRS",	0x024c},
+	{"linux/fd.h",	"FDRESET",	0x0254},
+	{"linux/fd.h",	"FDWERRORCLR",	0x0256},
+	{"linux/fd.h",	"FDRAWCMD",	0x0258},
+	{"linux/fd.h",	"FDTWADDLE",	0x0259},
+	{"linux/fd.h",	"FDEJECT",	0x025a},
+	{"linux/fd.h",	"FDSETDRVPRM",	0x0290},
+	{"linux/hdreg.h",	"HDIO_GETGEO",	0x0301},
+	{"linux/hdreg.h",	"HDIO_GET_UNMASKINTR",	0x0302},
+	{"linux/hdreg.h",	"HDIO_GET_MULTCOUNT",	0x0304},
+	{"linux/hdreg.h",	"HDIO_GET_QDMA",	0x0305},
+	{"linux/hdreg.h",	"HDIO_SET_XFER",	0x0306},
+	{"linux/hdreg.h",	"HDIO_OBSOLETE_IDENTITY",	0x0307},
+	{"linux/hdreg.h",	"HDIO_GET_KEEPSETTINGS",	0x0308},
+	{"linux/hdreg.h",	"HDIO_GET_32BIT",	0x0309},
+	{"linux/hdreg.h",	"HDIO_GET_NOWERR",	0x030a},
+	{"linux/hdreg.h",	"HDIO_GET_DMA",	0x030b},
+	{"linux/hdreg.h",	"HDIO_GET_NICE",	0x030c},
+	{"linux/hdreg.h",	"HDIO_GET_IDENTITY",	0x030d},
+	{"linux/hdreg.h",	"HDIO_GET_WCACHE",	0x030e},
+	{"linux/hdreg.h",	"HDIO_GET_ACOUSTIC",	0x030f},
+	{"linux/hdreg.h",	"HDIO_GET_ADDRESS",	0x0310},
+	{"linux/hdreg.h",	"HDIO_GET_BUSSTATE",	0x031a},
+	{"linux/hdreg.h",	"HDIO_TRISTATE_HWIF",	0x031b},
+	{"linux/hdreg.h",	"HDIO_DRIVE_RESET",	0x031c},
+	{"linux/hdreg.h",	"HDIO_DRIVE_TASKFILE",	0x031d},
+	{"linux/hdreg.h",	"HDIO_DRIVE_TASK",	0x031e},
+	{"linux/hdreg.h",	"HDIO_DRIVE_CMD",	0x031f},
+	{"linux/hdreg.h",	"HDIO_SET_MULTCOUNT",	0x0321},
+	{"linux/hdreg.h",	"HDIO_SET_UNMASKINTR",	0x0322},
+	{"linux/hdreg.h",	"HDIO_SET_KEEPSETTINGS",	0x0323},
+	{"linux/hdreg.h",	"HDIO_SET_32BIT",	0x0324},
+	{"linux/hdreg.h",	"HDIO_SET_NOWERR",	0x0325},
+	{"linux/hdreg.h",	"HDIO_SET_DMA",	0x0326},
+	{"linux/hdreg.h",	"HDIO_SET_PIO_MODE",	0x0327},
+	{"linux/hdreg.h",	"HDIO_SCAN_HWIF",	0x0328},
+	{"linux/hdreg.h",	"HDIO_SET_NICE",	0x0329},
+	{"linux/hdreg.h",	"HDIO_UNREGISTER_HWIF",	0x032a},
+	{"linux/hdreg.h",	"HDIO_SET_WCACHE",	0x032b},
+	{"linux/hdreg.h",	"HDIO_SET_ACOUSTIC",	0x032c},
+	{"linux/hdreg.h",	"HDIO_SET_BUSSTATE",	0x032d},
+	{"linux/hdreg.h",	"HDIO_SET_QDMA",	0x032e},
+	{"linux/hdreg.h",	"HDIO_SET_ADDRESS",	0x032f},
+	{"linux/raid/md_u.h",	"RAID_VERSION",	0x0910},
+	{"linux/raid/md_u.h",	"GET_ARRAY_INFO",	0x0911},
+	{"linux/raid/md_u.h",	"GET_DISK_INFO",	0x0912},
+	{"linux/raid/md_u.h",	"PRINT_RAID_DEBUG",	0x0913},
+	{"linux/raid/md_u.h",	"RAID_AUTORUN",	0x0914},
+	{"linux/raid/md_u.h",	"GET_BITMAP_FILE",	0x0915},
+	{"linux/raid/md_u.h",	"CLEAR_ARRAY",	0x0920},
+	{"linux/raid/md_u.h",	"ADD_NEW_DISK",	0x0921},
+	{"linux/raid/md_u.h",	"HOT_REMOVE_DISK",	0x0922},
+	{"linux/raid/md_u.h",	"SET_ARRAY_INFO",	0x0923},
+	{"linux/raid/md_u.h",	"SET_DISK_INFO",	0x0924},
+	{"linux/raid/md_u.h",	"WRITE_RAID_INFO",	0x0925},
+	{"linux/raid/md_u.h",	"UNPROTECT_ARRAY",	0x0926},
+	{"linux/raid/md_u.h",	"PROTECT_ARRAY",	0x0927},
+	{"linux/raid/md_u.h",	"HOT_ADD_DISK",	0x0928},
+	{"linux/raid/md_u.h",	"SET_DISK_FAULTY",	0x0929},
+	{"linux/raid/md_u.h",	"HOT_GENERATE_ERROR",	0x092a},
+	{"linux/raid/md_u.h",	"SET_BITMAP_FILE",	0x092b},
+	{"linux/raid/md_u.h",	"RUN_ARRAY",	0x0930},
+	{"linux/raid/md_u.h",	"STOP_ARRAY",	0x0932},
+	{"linux/raid/md_u.h",	"STOP_ARRAY_RO",	0x0933},
+	{"linux/raid/md_u.h",	"RESTART_ARRAY_RW",	0x0934},
 	{"linux/fs.h",	"BLKROSET",	0x125d},
 	{"linux/fs.h",	"BLKROGET",	0x125e},
 	{"linux/fs.h",	"BLKRRPART",	0x125f},
diff --git a/linux/ioctlsort.c b/linux/ioctlsort.c
index 0862b2e..afdcc5f 100644
--- a/linux/ioctlsort.c
+++ b/linux/ioctlsort.c
@@ -45,7 +45,7 @@ int main(int argc, char** argv) {
 	for (i = 0; i < nioctls; i++)
 		if (i == 0 || ioctls[i].code != ioctls[i-1].code ||
 		    strcmp (ioctls[i].name, ioctls[i-1].name))
-			printf("\t{\"%s\",\t\"%s\",\t%#lx},\n",
+			printf("\t{\"%s\",\t\"%s\",\t%#06lx},\n",
 				ioctls[i].header, ioctls[i].name, ioctls[i].code);
 
 	return 0;
-- 
1.7.4.1





More information about the Strace-devel mailing list