summaryrefslogtreecommitdiff
path: root/lib/libc/net/gethostnamadr.c
Commit message (Collapse)AuthorAgeFilesLines
* MFC r211276:Hajimu UMEMOTO2010-08-281-5/+17
| | | | | | | | | | | | | - When there is no room for returning the result, nss backend have to return ERANGE and terminate with NS_RETURN. - When gethostbyname_r(3) and the friends end with an error, set errno to the value nss backend returns, and return errno value. PR: kern/131623 Notes: svn path=/stable/8/; revision=211938
* Fix gethostbyaddr() prototype to conform to IEEE Std 1003.1 on 64 bitHajimu UMEMOTO2006-05-211-25/+22
| | | | | | | | | arch. X-MFC after: never Notes: svn path=/head/; revision=158791
* Fix gethostbyaddr() prototype to conform to IEEE Std 1003.1:Hajimu UMEMOTO2006-05-121-4/+14
| | | | | | | | | | | | | http://www.opengroup.org/onlinepubs/009695399/functions/gethostbyaddr.html gethostbyaddr_r() is changed as well. It breaks ABI backward compatibility on 64 bit arch. So, we fix it on 32 bit arch only for now. Reported by: Rostislav Krasny <rosti.bsd@gmail.com> Notes: svn path=/head/; revision=158477
* - Extend the nsswitch to support Services, Protocols and RpcHajimu UMEMOTO2006-04-281-1/+295
| | | | | | | | | | | databases. - Make nsswitch support caching. Submitted by: Michael Bushkov <bushman__at__rsu.ru> Sponsored by: Google Summer of Code 2005 Notes: svn path=/head/; revision=158115
* - make reentrant version of netdb functions glibc style API, andHajimu UMEMOTO2006-04-151-186/+225
| | | | | | | | | | expose them to outside of libc. - make netdb functions NSS friendly. Reviewed by: arch@ and current@ (no objection) Notes: svn path=/head/; revision=157779
* Update the resolver in libc to BIND9's one.Hajimu UMEMOTO2006-03-211-18/+22
| | | | | | | | | | | | | | | | | | | | | | | | | Since, res_sendsigned(3) and the friends use MD5 functions, it is hard to include them without having MD5 functions in libc. So, res_sendsigned(3) is not merged into libc. Since, res_update(3) in BIND9 is not binary compatible with our res_update(3), res_update(3) is leaved as is, except some necessary modifications. The res_update(3) and the friends are not essential part of the resolver. They are not defined in resolv.h but defined in res_update.h separately in BIND9. Further, they are not called from our tree. So, I hide them from our resolv.h, but leave them only for binary backward compatibility (perhaps, no one calls them). Since, struct __res_state_ext is not exposed in BIND9, I hide it from our resolv.h. And, global variable _res_ext is removed. It breaks binary backward compatibility. But, since it is not used from outside of our libc, I think it is safe. Reviewed by: arch@ (no objection) Notes: svn path=/head/; revision=156960
* oops, gethostbyaddr(3) must return h_addr as an IPv4-mappedHajimu UMEMOTO2005-04-301-0/+5
| | | | | | | | IPv6 address when RES_USE_INET6 was set, according to RFC 2133 section 6.2. Notes: svn path=/head/; revision=145728
* - do validation check and IPv4-mapped IPv6 address handling beforeHajimu UMEMOTO2005-04-291-1/+36
| | | | | | | | | | | | any query. - don't query against IPv6 link-local address. - use IN6_IS_ADDR_V4{MAPPED,COMPAT} macros. - use memcpy() instead of bcopy(). Inspired by: NetBSD Notes: svn path=/head/; revision=145687
* sync _map_v4v6_host*() with bind9's. it treats align better bit.Hajimu UMEMOTO2005-04-281-1/+1
| | | | | | | Obtained from: BIND9 Notes: svn path=/head/; revision=145635
* make gethostby*() thread-safe.Hajimu UMEMOTO2005-04-281-70/+162
| | | | Notes: svn path=/head/; revision=145633
* hide implementation specific internal functions from netdb.h.Hajimu UMEMOTO2005-04-271-0/+1
| | | | | | | it is needed to make get{host,net}by*() thread-safe. Notes: svn path=/head/; revision=145602
* ensure parsing numeric address before any host query.Hajimu UMEMOTO2005-04-251-13/+126
| | | | | | | Inspired by: NetBSD Notes: svn path=/head/; revision=145512
* Remove bogus non-reentrant "temporary" implementation of gethostbyaddr_r()Kris Kennaway2003-06-191-19/+0
| | | | | | | | | | that has been here for 6 years and 9 months. Reviewed by: deischen MFC After: 1 week Notes: svn path=/head/; revision=116574
* Catch up with nsdispatch.c: nsdispatch(3) is now `hidden' byJacques Vidrine2003-04-241-2/+4
| | | | | | | | | namespace.h. Sponsored by: DARPA, Network Associates Laboratories Notes: svn path=/head/; revision=113977
* Fix the style of the SCM ID's.David E. O'Brien2002-03-221-4/+2
| | | | | | | I believe have made all of libc .c's as consistent as possible. Notes: svn path=/head/; revision=92986
* Removed duplicate VCS ID tags, as per style(9).Ruslan Ermilov2001-08-131-2/+2
| | | | Notes: svn path=/head/; revision=81586
* Remove _THREAD_SAFE and make libc thread-safe by default byDaniel Eischen2001-01-241-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | adding (weak definitions to) stubs for some of the pthread functions. If the threads library is linked in, the real pthread functions will pulled in. Use the following convention for system calls wrapped by the threads library: __sys_foo - actual system call _foo - weak definition to __sys_foo foo - weak definition to __sys_foo Change all libc uses of system calls wrapped by the threads library from foo to _foo. In order to define the prototypes for _foo(), we introduce namespace.h and un-namespace.h (suggested by bde). All files that need to reference these system calls, should include namespace.h before any standard includes, then include un-namespace.h after the standard includes and before any local includes. <db.h> is an exception and shouldn't be included in between namespace.h and un-namespace.h namespace.h will define foo to _foo, and un-namespace.h will undefine foo. Try to eliminate some of the recursive calls to MT-safe functions in libc/stdio in preparation for adding a mutex to FILE. We have recursive mutexes, but would like to avoid using them if possible. Remove uneeded includes of <errno.h> from a few files. Add $FreeBSD$ to a few files in order to pass commitprep. Approved by: -arch Notes: svn path=/head/; revision=71579
* Make RES_OPTIONS=inet6 work.Hajimu UMEMOTO2000-10-271-0/+4
| | | | | | | | | Basically PR22196, but slightly modified. PR: bin/22196 Notes: svn path=/head/; revision=67709
* Add nsswitch support. By creating an /etc/nsswitch.conf file, you canJacques Vidrine2000-09-061-120/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | configure FreeBSD so that various databases such as passwd and group can be looked up using flat files, NIS, or Hesiod. = Hesiod has been added to libc (see hesiod(3)). = A library routine for parsing nsswitch.conf and invoking callback functions as specified has been added to libc (see nsdispatch(3)). = The following C library functions have been modified to use nsdispatch: . getgrent, getgrnam, getgrgid . getpwent, getpwnam, getpwuid . getusershell . getaddrinfo . gethostbyname, gethostbyname2, gethostbyaddr . getnetbyname, getnetbyaddr . getipnodebyname, getipnodebyaddr, getnodebyname, getnodebyaddr = host.conf has been removed from src/etc. rc.network has been modified to warn that host.conf is no longer used at boot time. In addition, if there is a host.conf but no nsswitch.conf, the latter is created at boot time from the former. Obtained from: NetBSD Notes: svn path=/head/; revision=65532
* Add unsigned char cast to isalphaAndrey A. Chernov1999-11-041-1/+1
| | | | Notes: svn path=/head/; revision=52865
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-2/+2
| | | | Notes: svn path=/head/; revision=50476
* Removed unnecessary initialization of hp in gethostbyaddr_r.Alexander Langer1997-12-251-3/+3
| | | | Notes: svn path=/head/; revision=31984
* Revert $FreeBSD$ to $Id$Peter Wemm1997-02-221-2/+2
| | | | Notes: svn path=/head/; revision=22993
* Make the long-awaited change from $Id$ to $FreeBSD$Jordan K. Hubbard1997-01-141-2/+2
| | | | | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise. Notes: svn path=/head/; revision=21673
* Merge in bind-4.9.4-P1 resolver...Peter Wemm1996-08-291-17/+20
| | | | Notes: svn path=/head/; revision=17903
* Submitted by: John Birrell <cimaxp1!jb@werple.net.au>Julian Elischer1996-08-201-2/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Here are the diffs for libc_r to get it one step closer to P1003.1c These make most of the thread/mutex/condvar structures opaque to the user. There are three functions which have been renamed with _np suffixes because they are extensions to P1003.1c (I did them for JAVA, which needs to suspend/resume threads and also start threads suspended). I've created a new header (pthread_np.h) for the non-POSIX stuff. The egrep tags stuff in /usr/src/lib/libc_r/Makefile that I uncommented doesn't work. I think its best to delete it. I don't think libc_r needs tags anyway, 'cause most of the source is in libc which does have tags. also: Here's the first batch of man pages for the thread functions. The diff to /usr/src/lib/libc_r/Makefile removes some stuff that was inherited from /usr/src/lib/libc/Makefile that should only be done with libc. also: I should have sent this diff with the pthread(3) man page. It allows people to type make -DWANT_LIBC_R world to get libc_r built with the rest of the world. I put this in the pthread(3) man page. The default is still not to build libc_r. also: The diff attached adds a pthread(3) man page to /usr/src/share/man/man3. The idea is that without libc_r installed, this man page will give people enough info to know that they have to build libc_r. Notes: svn path=/head/; revision=17706
* General -Wall warning cleanup, part I.Jordan K. Hubbard1996-07-121-2/+7
| | | | | | | Submitted-By: Kent Vander Velden <graphix@iastate.edu> Notes: svn path=/head/; revision=17141
* Remove trailing whitespace.Rodney W. Grimes1995-05-301-3/+3
| | | | Notes: svn path=/head/; revision=8870
* Change strtok() to strsep(), cause memory corruption for allAndrey A. Chernov1995-03-241-10/+16
| | | | | | | | | | programs which use strtok() too in the same time. Fix potential NULL reference, depends of /etc/hosts.conf format Fix the bug when service name fetched always from beginning of the line, not from parsed token. Notes: svn path=/head/; revision=7324
* get* rework and new bind codePaul Traina1994-09-251-485/+37
| | | | Notes: svn path=/head/; revision=3070
* Fix gethostbyaddr():Geoff Rehmet1994-08-281-2/+2
| | | | | | | | call _getdnsbyaddr() instead of _getdnsbyname() ;-) Submitted by: Geoff Notes: svn path=/head/; revision=2330
* Fixed typo.Garrett Wollman1994-08-091-2/+2
| | | | Notes: svn path=/head/; revision=1992
* Add (substantially re-written) support for /etc/host.conf, and reintegratedGarrett Wollman1994-08-091-11/+196
| | | | | | | | | | | | 1.1.5 support for YP, fixing a bug in 1.1.5 that prevented YP from ever working reliably. (I'm amazed that there were no bug reports.) IWBRNI someone could write a host.conf(5) manual page. Please look at the code before doing so; this version is somewhat more flexible in the format of its input. Notes: svn path=/head/; revision=1991
* BSD 4.4 Lite Lib SourcesRodney W. Grimes1994-05-271-0/+452
Notes: svn path=/cvs2svn/branches/unlabeled-1.1.1/; revision=1573