aboutsummaryrefslogtreecommitdiff
path: root/lib/libc/net/getnetnamadr.c
Commit message (Collapse)AuthorAgeFilesLines
* libc: Purge unneeded cdefs.hWarner Losh2023-11-011-1/+0
| | | | | | | | | These sys/cdefs.h are not needed. Purge them. They are mostly left-over from the $FreeBSD$ removal. A few in libc are still required for macros that cdefs.h defines. Keep those. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D42385
* Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-161-2/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-05-121-1/+1
| | | | | | | | | The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
* libc/net/getnetnamadr.c: Mark write-only variables as unusedKonstantin Belousov2021-11-291-8/+8
| | | | | Sponsored by: The FreeBSD Foundation MFC after: 1 week
* Fix -Wvoid-pointer-to-enum-cast warnings.Brooks Davis2020-04-151-3/+3
| | | | | | | | | | | | | | | | | This pattern is used in callbacks with void * data arguments and seems both relatively uncommon and relatively harmless. Silence the warning by casting through uintptr_t. This warning is on by default in Clang 11. Reviewed by: arichardson Obtained from: CheriBSD (partial) MFC after: 1 week Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D24425 Notes: svn path=/head/; revision=359978
* libc: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-251-0/+2
| | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using mis-identified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Notes: svn path=/head/; revision=326193
* libc: spelling fixes.Pedro F. Giffuni2016-04-301-1/+1
| | | | | | | Mostly on comments. Notes: svn path=/head/; revision=298830
* Add declarations to netdb_private.h to eliminate -Wmissing-prototypes warnings.Craig Rodrigues2015-09-201-7/+0
| | | | Notes: svn path=/head/; revision=288015
* - When there is no room for returning the result, nss backendHajimu UMEMOTO2010-08-131-4/+12
| | | | | | | | | | | | | 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 MFC after: 2 weeks Notes: svn path=/head/; revision=211276
* - Extend the nsswitch to support Services, Protocols and RpcHajimu UMEMOTO2006-04-281-4/+237
| | | | | | | | | | | 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-71/+91
| | | | | | | | | | expose them to outside of libc. - make netdb functions NSS friendly. Reviewed by: arch@ and current@ (no objection) Notes: svn path=/head/; revision=157779
* - Remove padding for ABI compatibility of n_net member from structHajimu UMEMOTO2005-06-031-5/+1
| | | | | | | | | | | | | | | | netent. - Change 1st argument of getnetbyaddr() to an uint32_t on 64 bit arch as well to confirm to POSIX-2001. These changes break ABI compatibility on 64 bit arch. There is similar padding issue for ai_addrlen of struct addrinfo. However, it is leaved as is for now. Discussed on: arch@, standards@ and current@ X-MFC after: never Notes: svn path=/head/; revision=146904
* - The ai_addrlen of a struct addrinfo used to be a size_t, perHajimu UMEMOTO2005-05-151-3/+8
| | | | | | | | | | | | | | | | | | | RFC 2553. In XNS5.2, and subsequently in POSIX-2001 and RFC 3493, it was changed to a socklen_t. And, the n_net of a struct netent used to be an unsigned long integer. In XNS5, and subsequently in POSIX-2001, it was changed to an uint32_t. To accomodate for this while preserving ABI compatibility with the old interface, we need to prepend or append 32 bits of padding, depending on the (LP64) architecture's endianness. - Correct 1st argument of getnetbyaddr() to uint32_t on 32 bit arch. Stay as is on 64 bit arch for ABI backward compatibility for now. Reviewed by: das, peter MFC after: 2 weeks Notes: svn path=/head/; revision=146244
* make getnetby*() thread-safe.Hajimu UMEMOTO2005-04-281-26/+107
| | | | Notes: svn path=/head/; revision=145626
* 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
* 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-3/+2
| | | | | | | I believe have made all of libc .c's as consistent as possible. Notes: svn path=/head/; revision=92986
* getnetbyaddr() should be serviced by the "networks" database.Ruslan Ermilov2001-10-101-1/+1
| | | | Notes: svn path=/head/; revision=84760
* Remove _THREAD_SAFE and make libc thread-safe by default byDaniel Eischen2001-01-241-1/+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
* Add nsswitch support. By creating an /etc/nsswitch.conf file, you canJacques Vidrine2000-09-061-125/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-1/+1
| | | | Notes: svn path=/head/; revision=50476
* Merge in bind-4.9.6 resolver changes. Note that they resolve thePeter Wemm1997-06-271-2/+1
| | | | | | | overflow problem differently. Notes: svn path=/head/; revision=26974
* 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
* Here goes.. Bring the 4.9.5-P1 resolver into -current. This has thePeter Wemm1996-12-301-3/+3
| | | | | | | | DNSSEC stuff, among other things. There are also some renamed functions, I've left out the res_stubs.c from this commit in case cvs bombs out.. Notes: svn path=/head/; revision=21057
* Merge in bind-4.9.4-P1 resolver...Peter Wemm1996-08-291-21/+7
| | | | Notes: svn path=/head/; revision=17903
* General -Wall warning cleanup, part I.Jordan K. Hubbard1996-07-121-2/+9
| | | | | | | 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
* Sicnce this code shares the same fragment as gethostnamaddr:Andrey A. Chernov1995-03-241-10/+16
| | | | | | | | | | | Change strtok() to strsep(), cause memory corruption for all 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=7325
* Use same configuration file, /etc/host.conf, for both gethost* andGarrett Wollman1994-09-261-7/+9
| | | | | | | | | getnet* configuration. (It's highly unlikely that you'd want to do something different, and network lookups aren't common enough to justify their own configuration file.) Notes: svn path=/head/; revision=3136
* get* rework and new bind codePaul Traina1994-09-251-0/+190
Notes: svn path=/head/; revision=3070