Re: Equivalent of gethostbyname_r for Mac OS X?
site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com -- Marc Majka _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... The following routines are all thread-safe. You may safely ignore comments in the man pages that suggest otherwise. - alias_getbyname alias_getent alias_setent alias_endent - bootp_getbyether bootp_getbyip - bootparams_getbyname bootparams_getent bootparams_setent bootparams_endent - getfsbyname getfsspec getfsfile getfsent setfsent endfsent - initgroups getgrnam getgrgid getgrent setgrent endgrent - gethostbyaddr gethostbyname gethostbyname2 gethostent sethostent endhostent - getipnodebyname getipnodebyaddr - innetgr getnetgrent setnetgrent endnetgrent - getnetbyaddr getnetbyname getnetent setnetent endnetent - prdb_getbyname prdb_get prdb_set prdb_end - getprotobyname getprotobynumber getprotoent setprotoent endprotoent - getrpcbyname getrpcbynumber getrpcent setrpcent endrpcent - getservbyport getservbyname getservent setservent endservent - getpwnam getpwuid getpwent setpwent endpwent They all cache returned data in per-thread storage. The threads correctly release the cached structures on subsequent calls. Memory is reclaimed when threads exit by a destructor routine. For those with an interest in seeing the implementation, see the lu_utils.[ch] files and any one of the lu_*.c routines (e.g. lu_host.c) in the Libinfo project: http://www.opensource.apple.com/darwinsource/ 10.4.6.ppc/Libinfo-222.1/lookup.subproj/lu_host.c This email sent to site_archiver@lists.apple.com
participants (1)
-
Marc Majka