| Summary: | gethostbyname is not thread safe | ||
|---|---|---|---|
| Product: | Base System | Reporter: | hook <hook> |
| Component: | kern | Assignee: | freebsd-threads (Nobody) <threads> |
| Status: | Closed FIXED | ||
| Severity: | Affects Only Me | ||
| Priority: | Normal | ||
| Version: | Unspecified | ||
| Hardware: | Any | ||
| OS: | Any | ||
|
Description
hook
2000-05-26 07:50:00 UTC
Responsible Changed From-To: freebsd-bugs->freebsd-threads Assign to threads mailing list > The gethostbyname() is not thread safe. It causes lock ups if >compiled with threads. It would be helpful if this is mentioned in >the docs or if a thread-safe version is provided (gethostbyname_r >?) The gethostbyname() man page mentions in the BUGS section: "These functions use static data storage; if the data is needed for future use, it should be copied before any subsequent calls overwrite it." You should use the getaddrinfo() function which is reentrant, since it doesn't use static data storage. I think this PR should be closed. -- Craig Rodrigues rodrigc@crodrigues.org State Changed
From-To: open->closed
I think it was fixed in 6.0, it is thread safe:
> These functions use a thread-specific data storage; if the data is needed
> for future use, it should be copied before any subsequent calls overwrite
> it.
|