Marcus Brinkmann <[EMAIL PROTECTED]> writes:

> From a quick glance, argp seems to be reentrant, is this really
> true? Are there any (better) alternatives?

argp (at least the version in glibc-2.2.5, which is the latest glibc I
have around) uses getopt, which is inherently non-reentrant. There
sems to be some locking of the "getopt resource" going on, but I'm not
sure exactly what it does.

A while ago I hacked argp to get it to build separately from glibc,
and I also changed it to not use getopt. Miles Bader said he would
look at integrating it, but I haven't heard anything about it for a
year or so. Anyway, my code can be found at

  cvs -d :pserver:[EMAIL PROTECTED]:/cvsroot/lsh co argp

That should be fully reentrant, and simpler, because it doesn't have
to create any getopt_long arguments like the old code.

Perhaps one could create a new flag, say OPTION_PARELLEL, one you can
set on an option in a parent parser that says that the option should
be processed by all children (and it's probably easier to implement
"by all descendants" than "by all children", given that argp organizes
the groups in a _linear_ list corresponding to preorder traversal of
the tree of parsers).

/Niels

_______________________________________________
Bug-hurd mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-hurd

Reply via email to