Question

getpwnam_r() is reentrant according a number of manpages. However, the standard only state

The getpwnam_r() function is thread-safe and returns values in a user-supplied buffer instead of possibly using a static data area that may be overwritten by each call.

I am confused. Must a NSS Module's ...getpwnam_r() function reentrant? Or just thread-safe is enough?

Was it helpful?

Solution

Well, as you note the standard requires that the function must be thread-safe. That doesn't prevent an implementation from providing a stricter guarantee.

IOW, portable software cannot assume that getpwnam_r is reentrant. But, if you care only about some specific platform which guarantees that it's reentrant, then presumably you can assume that.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top