bug-glibc
[Top][All Lists]
Advanced

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

Re: (non)reentrancy


From: Patrick Pfeifer
Subject: Re: (non)reentrancy
Date: Thu, 5 Jun 2003 14:58:42 +0200

On on Thu, 5 Jun 2003 04:00:54 +0200, Patrick Pfeifer wrote:
> reentrent functions are great!!!
> 
> nonreentrant ones are a bit obscure to me.
> i just spent an hour debugging my pam_wheel-hack,
> because it uses nonreentrant get{pw,gr}{uid,nam}.
> 
> the data i wanted got lost on the way down, it's
> particulary strange, that the other hack worked,
> where i examined the data just a few lines before.
> 
> anyways - those _non_reentrant functions - how
> does that work with a _shared_ (read: shared
> by different processes in a multithreaded env.)
> library? - does the library keep a seperate
> return data area for each process, or do you have
> to be fast and lucky to examine the data you requested ???
> 

im pleased to see that my test program works:
#include <pwd.h>
main() {
        struct passwd *p = getpwnam("pat");
        if (fork()) {
                wait(-1);
                printf("pat: %s\n", p->pw_name);
                return 0;
        }
        p = getpwnam("software");
        printf("software: %s\n", p->pw_name);
        return 0;
}
gives
+ software: software
+ pat: pat
as expected - anywasy

> RTFS, i know - but in the glibc-tree its really
> hard to get where you want - i tried only once
> and saw nothing but macros, macros, macros

the macros are still there, could you tell me where
that logic is implemented - or am i on the wrong list

> 
> thank you for your time
> 
> patrick
> 




reply via email to

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