Question for Vodz about getopt_ulflags
Rob Landley
rob at landley.net
Wed May 3 21:56:50 UTC 2006
On Wednesday 03 May 2006 6:13 am, Tito wrote:
> I am trying to use bb_getopt_ulflags in hdparm,
> but it seems to me that unsigned long opts
> returned by bb_getopt_ulflags is not big enough
> to hold the value for all the options.
...
> The opt strings is:
> static const char hdparm_options[]=
> "VvgfqunprmckaBtThdSDPXKALWCyYzZURQwxb";
>
> Is there a solution?
We could return a long long, but I'd rather not go there. Any app with more
than 32 arguments probably has too many arguments. Personally, I'd look and
see if there's anything we can jettison to get it down to 32. (Going from
the hdparm man page, -E is useless, -h is already handled (as --help or -? in
generic code), -Z is something the kernel should do for us as a quirk on that
hardware, and -v is the default.)
Another alternative is that if we can't get it down to 32, then a uint flags
isn't an appropriate return value, which would suggest not using
getopt_ulflags()...
Rob
--
Never bet against the cheap plastic solution.
More information about the busybox
mailing list