help-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Reentrant argp


From: M. Gerards
Subject: Re: Reentrant argp
Date: Tue, 20 May 2003 12:35:01 +0200
User-agent: Internet Messaging Program (IMP) 3.1

> > So I cannot trust the comments in the code and it doesn't work or should I
> be 
> > carefull when using it recursively?
> 
> For recursive calls, you have to use
> 
>   /* This hack to allow programs that know what's going on to call argp
>      recursively.  If someday argp is changed not to use the non-reentrant
>      getopt interface, we can get rid of this shit.  XXX */
>   void
>   _argp_unlock_xxx (void)
>   {
>     UNLOCK_GETOPT;
>   }
> 
> This is from the glibc version, of course. I don't really know what
> else is needed, you could try to save and restore optind, but you
> can't do that with getopt's nextchar, because that is static in
> getopt.c.

Seems like I have to unlock to me, but this is not required: I haven't used 
this in my code and my code works perfectly (= it doesn't deadlock).

> > > I think the glibc folks are aware of it. I also mail Miles to remind
> > > him once a year or so ;-)
> > 
> > URG :(
> > 
> > How long will it take before this code will be in glibc (I mean: what do
> you 
> > expect)? Otherwise I'll rewrite my code :(
> 
> I have no idea. What's needed is some glibc hacker with some time and
> interest in putting the code back into glibc. And then it will take
> some time to sort out any problems that occur.

ah, sounds like I shouldn't use argp and write my own parser.

Thanks,
Marco




reply via email to

[Prev in Thread] Current Thread [Next in Thread]