DragonFly BSD
DragonFly kernel List (threaded) for 2003-12
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: LibC status and others...


From: Dave Leimbach <leimySPAM2k@xxxxxxx>
Date: 10 Dec 2003 18:29:47 -0600

Dave Leimbach <leimySPAM2k@xxxxxxx> writes:

> Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxx> writes:
> 
> 
> >     We aren't going to be using NSS in that way... we will be using IPC
> >     services for such lookups.  But if you need a getpwnam_r() it should
> >     be possible to adapt the existing getpwnam() (and other functions) in
> >     /usr/src/lib/libc/gen/getpwent.c.
> > 
> >     What I would do is rename, e.g., getpwnam() to getpwnam_r(), add the
> >     required passwd pointer, and use the pointer instead of the static 
> >     _pw_passwd.  Then write a new getpwnam() which simply aclls
> >     getpwnam_r() using &_pw_passwd for the passwd pointer.
> 
> It is not implemented the way you think I fear :).  There are no static data
> members in getpwnam...  Some other internal function keeps the static data.
> 

Its actually very different.  The re-entrant form takes a lot more
parameters and returns an int I believe.

int 
getpwnam_r(const char *, struct passwd *, char *, size_t, struct
passwd **);

vs 

struct passwd * 
getpwnam(const char *);


Dave



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