LibC status and others...

Jeroen Ruigrok/asmodai asmodai at wxs.nl
Wed Dec 10 23:04:34 PST 2003


-On [20031211 00:52], Matthew Dillon (dillon at xxxxxxxxxxxxxxxxxxxx) wrote:
>    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.

Wish it were that easy.

You need to account for a multiple of things:

- thread-safety
- reentrancy
- (asynchronous) cancellation-safety
- asynchronous signal-safety

POSIX threads defines getpwnam_r() as a function which may be
implemented as a cancellation point.

-- 
Jeroen Ruigrok van der Werven <asmodai(at)wxs.nl> / asmodai / kita no mono
PGP fingerprint: 2D92 980E 45FE 2C28 9DB7  9D88 97E6 839B 2EAC 625B
http://www.tendra.org/   | http://diary.in-nomine.org/
To meet, to know, to love - and then to part, is the sad tale of many a
heart...





More information about the Kernel mailing list