문제

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?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top