Bug 29581

Summary: proposed gethostbyXXXX_r() implementation
Product: Base System Reporter: Alexander Litvin <Litvin"@FreeBSD.org>
Component: binAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 5.0-CURRENT   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description Alexander Litvin freebsd_committer freebsd_triage 2001-08-09 21:10:19 UTC
	Below is a patch, which adds implementation of gethostbyname_r()
	and gethostbyaddr_r() reentrant functions to FreeBSD libc.
	Notes:
	 * Patch essentially eliminates usage of static buffers
		 when gethostbyXXXX_r are called.
	 * Also, global _res and h_errno are replaced by
		 function calls (similar to errno) and for threaded
		 applications are stored in thread-specific data
	 * Although all static variables relevant to gethostbyXXXX()
		 and resolver library were eliminated, to clame that
		 this implementation is thread-safe it is necessary
		 to check all possible code paths.
	 * Patch implements reentrant functions only for dns/files
		 configuration. In case of nis implementation is not
		 reentrant. This can be easily done (it looks easier
		 then to modify dns/files code) , but I chose to omit
		 this, because I have no environment to test it.
	 * Code was not tested on non-i386 hardware.

Fix: ----------------------------
Comment 1 Maxim Sobolev freebsd_committer freebsd_triage 2002-08-09 17:03:08 UTC
Responsible Changed
From-To: freebsd-bugs->sobomax

I'll take this.
Comment 2 Martin Blapp freebsd_committer freebsd_triage 2003-02-22 17:50:33 UTC
Responsible Changed
From-To: sobomax->nectar

Jacques is working on this.
Comment 3 Mark Linimon freebsd_committer freebsd_triage 2006-03-24 05:45:35 UTC
Responsible Changed
From-To: nectar->freebsd-bugs

Reassign; nectar is away from FreeBSD work at the moment.
Comment 4 Antoine Brodin freebsd_committer freebsd_triage 2008-03-21 20:13:04 UTC
State Changed
From-To: open->closed

Close: 
ume@ made gethostby*() thread-safe in may-april 2005. 
This work has been merged to RELENG_5 and RELENG_6. 
He also made reentrant version of netdb functions glibc 
style API in april 2006 (merged to RELENG_6 in july 2006). 
Thanks for the report.