[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 09:59:43 +0200 |
User-agent: |
Internet Messaging Program (IMP) 3.1 |
> "M. Gerards" <metgerards@student.han.nl> writes:
>
> > For the screensaver patch I sent yesterday to bug-hurd I assumed argp is
> > reentrant. Is this really the case for GNU/Hurd? It is for GNU/Linux, but
> I'm
> > not sure yet about GNU/Hurd.
>
> argp uses getopt. getopt uses global variables to keep state. And as
> far as I know getopt doesn't use tricks like thread local storage.
> So it's not reentrant.
There is some comment about this in glibc, IIRC a lock is used for getopt. So I
wonder if this locking also works for the Hurd (Marcus had doubts, I cannot
remember the details).
> My hacked argp,
> http://www.lysator.liu.se/~nisse/misc/argp-standalone-1.2.tar.gz
> doesn't depend on getopt, and doesn't use global variables.
Ahh, interesting. Have you sent a patch to the glibc mailinglist? This would be
_really_ usefull for me :)
Thanks,
Marco