On Thu, Aug 07, 2003 at 11:48:41PM +0200, Marco Gerards wrote: > Already tried to use an argp parser, and that worked. Unfortunately > there were issues with the argp parser, argp isn't reentrant. (I guess > I was lucky when I used it).
Hmm, I don't see a reason why this wouldn't work. The problem is when different threads use argp at the same time, but this can't happen with the locks protecting argp. These locks are recursive, recursively calling argp doesn't cause a deadlock. Of course the getopt interface uses some global variables: opterr, optopt, optind and optarg. optopt and optind are set everytime before calling getopt() and only used just after that, so that doesn't give any trouble. optarg is just is used just after getopt() and points into argv itself and not some statically allocated buffer, I don't see any trouble here either. The only problem is opterr: It's set only when initializing argp. So as long as you don't use ARGP_NO_ERRS (the only flag which changes opterr) in the one and not in the other it shouldn't cause a problem AFAICS. Jeroen Dekkkers _______________________________________________ Bug-hurd mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/bug-hurd