[Toybox] New toy: mknod

Rob Landley rob at landley.net
Mon Feb 20 16:22:25 PST 2012


On 02/13/2012 01:12 PM, Elie De Brauwer wrote:
> Hi all,
> 
> In attachment you can find a new version of mknod. Two small comments:

--- a/lib/args.c        Mon Feb 13 17:15:49 2012 +0100
+++ b/lib/args.c        Mon Feb 13 19:58:48 2012 +0100
@@ -14,7 +14,7 @@
 //     * plus a string argument, appended to a list
-//     # plus a signed long argument
+//     # plus a signed long argum[ent
 //       <LOW     - die if less than LOW

I'm rather not take the patch with a pure-typo hunk in it, and I'm not
quite sure what editing the hunk out from an hg merge would do.

Can you respin without that file?

> 1. mknod uses this awkward non-getopt-like syntax (you know mknod
> /dev/null c 1 3) for now I'm using optargs for all of them with a limit
> stating the number of arguments should be between 2 and 4.  If anybody
> could point into ways in which the argument parsing could be more
> helpful that would be appreciated.

It's funny that susv4 hasn't got mknod, but _does_ have mkfifo.  (Sigh.)

Meaning that mknod's "p" option probably isn't a big deal, since it
duplicates mkfifo. I wonder if Red Hat 9 (circa 2003) had this?

FYI: back in the busybox days I created a Red Hat 9 image and put it at
http://busybox.net/downloads/qemu/ so I could fire it up under qemu and
test _exactly_ this sort of thing...

Yup, Red Hat 9 had "p" too.  Huh.

> 2. mknod typically has support for passing the mode with -m, I haven't
> added this (yet) (and if you want it just chmod it afterwards, oh, right
> chmod isn't there yet either), but I think that it might be worth to
> extend argument passing in lib/args.c for reading modes, at least chmod
> would already benefit from that too.

I think I mentioned i want to add -m to the generic option parsing
stuff.  I can work on that...

Could you resubmit without the typo hunk?

Thanks,

Rob



More information about the Toybox mailing list