summaryrefslogtreecommitdiffstats
path: root/lib/libc/net/getservent.c
Commit message (Collapse)AuthorAgeFilesLines
* libc: Make various internal file descriptors from fopen() close-on-exec.jilles2013-08-231-2/+2
|
* Use the stored length value instead of calculating it by strlen().ume2010-04-061-8/+6
|
* Add capability to use a db version of services. It is enabled byume2010-04-041-0/+202
| | | | | | specifying `db' as source of service in /etc/nsswitch.conf. MFC after: 2 weeks
* Reduce duplicate code.ume2010-04-041-59/+33
| | | | MFC after: 2 weeks
* Treat '+' as special only when in compat mode, and simplifyume2010-04-041-22/+19
| | | | | | the logic bit. MFC after: 2 weeks
* Stop adding trailing '\n'. The servent_unpack() doesn't expectume2010-04-041-10/+3
| | | | | | lines terminated with '\n'. MFC after: 2 weeks
* Per Regents of the University of Calfornia letter, remove advertisingimp2007-01-091-4/+0
| | | | | | clause. # If I've done so improperly on a file, please let me know.
* - Extend the nsswitch to support Services, Protocols and Rpcume2006-04-281-250/+1058
| | | | | | | | databases. - Make nsswitch support caching. Submitted by: Michael Bushkov <bushman__at__rsu.ru> Sponsored by: Google Summer of Code 2005
* - make reentrant version of netdb functions glibc style API, andume2006-04-151-43/+92
| | | | | | | expose them to outside of libc. - make netdb functions NSS friendly. Reviewed by: arch@ and current@ (no objection)
* Include <sys/types.h> and <limits.h> ourselves, don't assume they are includedstefanf2005-08-201-0/+1
| | | | | | | | | | through <pthread.h>. gen/sem.c: Prerequisite for <_semaphore.h> net/getprotoent.c: USHRT_MAX net/getservent.c: USHRT_MAX stdio/ungetwc.c: MB_LEN_MAX stdio/vfwscanf.c: MB_LEN_MAX
* make getnetby*() thread-safe.ume2005-04-281-5/+5
|
* rename the NIS related fields to have yp_ prefix.ume2005-04-181-24/+24
| | | | Suggested by: delphij
* Do not check whether a pointer is NULL, since free(3) already takes care ofdelphij2005-04-181-6/+3
| | | | | | this case. Reviewed by: ume
* Fix build for !YP case.delphij2005-04-171-0/+4
| | | | | BTW. Shall we change these fields to have yp_ prefix? That will make the code easier to read.
* libc-internal interfaces should have two underscores in frontume2005-04-171-4/+4
| | | | | | of their names. Pointed out by: das
* - add getserv{byname,byport,ent}_r for internal use within libc.ume2005-04-151-85/+160
| | | | | | - make getserv{byname,byport,ent} thread-safe. Reviewed by: gnn
* Don't ignore the last line of config file (/etc/hosts, /etc/services, etc)sobomax2005-01-031-3/+2
| | | | | | | | which doesn't end in \n, since it may be very confusing. Also this should increase consistency, since most other config files work just fine regardless of the presence of traling \n in the last line. MFC After: 2 weeks
* Eliminate 19 warnings in libc (at level WARNS=2) of thenectar2003-02-271-2/+1
| | | | `implicit declaration of function' variety.
* Remove __P() usage.obrien2002-03-211-1/+1
|
* Remove 'register' keyword.obrien2002-03-211-1/+1
|
* Remove trailing characters from #endif.obrien2002-03-151-3/+0
| | | | Actually this #endif is not needed, so remove leading characters also.
* o Move NTOHL() and associated macros into <sys/param.h>. These aremike2002-02-181-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | deprecated in favor of the POSIX-defined lowercase variants. o Change all occurrences of NTOHL() and associated marcros in the source tree to use the lowercase function variants. o Add missing license bits to sparc64's <machine/endian.h>. Approved by: jake o Clean up <machine/endian.h> files. o Remove unused __uint16_swap_uint32() from i386's <machine/endian.h>. o Remove prototypes for non-existent bswapXX() functions. o Include <machine/endian.h> in <arpa/inet.h> to define the POSIX-required ntohl() family of functions. o Do similar things to expose the ntohl() family in libstand, <netinet/in.h>, and <sys/param.h>. o Prepend underscores to the ntohl() family to help deal with complexities associated with having MD (asm and inline) versions, and having to prevent exposure of these functions in other headers that happen to make use of endian-specific defines. o Create weak aliases to the canonical function name to help deal with third-party software forgetting to include an appropriate header. o Remove some now unneeded pollution from <sys/types.h>. o Add missing <arpa/inet.h> includes in userland. Tested on: alpha, i386 Reviewed by: bde, jake, tmm
* Small yet significant tweaks/cleanups:wpaul1996-12-271-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | - getservent: o put _yp_check() proto under #ifdef YP where it belongs o local YP buffers should be YPMAXRECORD + 2 bytes long and should be NUL terminated after copying - gethostbynis: o local YP buffer should be YPMAXRECORD + 2 bytes long - getnetbynis: o local YP buffer should be YPMAXRECORD + 2 bytes long and should be NUL terminated after copying - ether_addr: o local YP buffers should be YPMAXRECORD + 2 bytes long and should be NUL terminated after copying (in this case it's BUFSIZ + 2 bytes, but it happens that BUFSIZ == YPMAXRECORD. - gethostbydns: o nuke stray 'return(NULL)' in __dns_getanswer() (harmless but looks silly) These are 2.2 candidates. I will wait a few days to make sure these don't break anything and then, if there are no objections, move them to the 2.2 branch.
* Eliminate 3 more examples of gratutiously passing arrays by address.jkh1996-12-051-3/+3
| | | | | Everyone please call ParaSoft today and say "I will buy 57 copies of Insure++ tomorrow, but first I want a FreeBSD version." :-)
* General -Wall warning cleanup, part I.jkh1996-07-121-0/+2
| | | | Submitted-By: Kent Vander Velden <graphix@iastate.edu>
* Improve NIS performace of getservbyname() and getservbyport(). Both thesewpaul1996-06-011-7/+95
| | | | | | | | | | | | | | | | | | | | | | functions are implimented as wrappers around getservent(), which means it's up to getservent() to do all the work. The NIS support in getservent() only allows it to scan through the services.byname map one entry at a time until it finds the requested service name/port. This can be painfully slow due to the overhead involved (lots and lots of successive RPCs). To fix this, we allow getservbyname() and getservbyport() to signal getservent() that if NIS is turned on (there's a '+' in /etc/services), the usual yp_first()/yp_next() linear search should be abandoned and yp_match() used instead. This causes getservent() to immediately locate the requested entry instead of wasting time groping through the whole map. The downside is that this trick is accomplished by exporting a couple of pointers from getservent.c which getservbyname.c and getservbyport.c can preset in order to tell getservent() what to do. If all three functions were in the same source module, then the extra cruft could be delcared static to avoid poluting the global symbol space. Maybe they should be combined anyway. For now I've settled on prepending lots of underscores.
* Getpwent() and getservent() can wind up calling free() withmpp1996-01-291-1/+0
| | | | | an invalid pointer if a call to yp_first() fails. Closes PR # 964, and possibly # 952.
* Add NIS support to getservent(3) functions (getservbyport() and getservbyname()wpaul1995-11-041-0/+68
| | | | | | | | both call getservent() to do most of the work, so we only need to modify this file to take care of everybody). Note that there is only one NIS services map (services.byname) even though there are getservbyname() and getservbyport() library functions.
* BSD 4.4 Lite Lib Sourcesrgrimes1994-05-271-0/+121
OpenPOWER on IntegriCloud