[rfc] xioctl()

Mike Frysinger vapier at gentoo.org
Sat Jun 23 17:26:54 UTC 2007


i was poking around the raid stuff and thought that the form:
	if (ioctl(...) != 0)
		bb_perror_msg_and_die("ioctl");
seemed pretty common ... and indeed it is:
console-tools/deallocvt.c
console-tools/loadfont.c
console-tools/setconsole.c
console-tools/setkeycodes.c
console-tools/setlogcons.c
loginutils/getty.c
loginutils/vlock.c
miscutils/devfsd.c
miscutils/eject.c
miscutils/mt.c
miscutils/raidautorun.c
networking/arp.c
networking/arping.c
networking/ether-wake.c
networking/ifconfig.c
networking/interface.c
networking/nameif.c
networking/route.c
networking/slattach.c
networking/traceroute.c
networking/vconfig.c
networking/zcip.c
util-linux/fbset.c
util-linux/fdformat.c
util-linux/fdisk.c
util-linux/hwclock.c

these are the much more common ioctl() form which takes three parameters: the 
fd, the command, and an argument (pointer, whatever)

there is some information lost here in terms of the error message, but i 
honestly dont think it's a big deal plus we'll save on string space ;)

a quick sample here (i thought there was a `make` command to do this 
automatically ...):

before:
   4030       0      12    4042     fca libbb/xfuncs.o
    115       0       0     115      73 miscutils/raidautorun.o
    145       0       0     145      91 console-tools/deallocvt.o

after:
   4097       0      12    4109    100d libbb/xfuncs.o
     91       0       0      91      5b miscutils/raidautorun.o
    113       0       0     113      71 console-tools/deallocvt.o
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 827 bytes
Desc: This is a digitally signed message part.
Url : http://lists.busybox.net/pipermail/busybox/attachments/20070623/e28eb963/attachment-0002.pgp 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: busybox-xioctl.patch
Type: text/x-diff
Size: 1998 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20070623/e28eb963/attachment-0002.bin 


More information about the busybox mailing list