From 5f0e6fc702296840d2daa39f83f6cb1e40073d58 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Tue, 25 Jun 1996 08:56:57 +0000 Subject: Tue Jun 25 02:59:11 1996 Roland McGrath * malloc/malloc.h: Declare malloc_object_allocated_size, malloc_walk. * malloc/Makefile (dist-routines): Add malloc-size, malloc-walk. * malloc/malloc-size.c: New file. * malloc/malloc-walk.c: New file. * malloc/malloc-find.c (malloc_find_object_address): Return null if PTR is outside the heap. * elf/dl-load.c (_dl_map_object): If the requested name matches the soname of a loaded object, use that object. Mon Jun 24 19:57:01 1996 Roland McGrath * Makefile (subdirs): Add nss. * inet/Makefile (routines): Add getrpcent, getrpcbyname, getrpcbynumber, getrpcent_r, getrpcbyname_r, getrpcbynumber_r. * inet/getrpcbynumber_r.c: New file. * inet/getrpcbynumber.c: New file. * inet/getrpcbyname.c: New file. * inet/getrpcbyname_r.c: New file. * inet/getrpcent_r.c: New file. * inet/getrpcent.c: New file. * nss/rpc-lookup.c: New file. * nss/nss_files/files-rpc.c: New file. * nss/Makefile (routines): Add rpc-lookup. (libnss_files-routines): Add files-rpc. * sunrpc/Makefile (routines): Remove getrpcent. * sunrpc/getrpcent.c: File removed. * nss/getXXent_r.c (REENTRANT_GETNAME): Clear NO_MORE when NIP is non-null on entry. * Makeconfig (rpath-link): Add $(nssobjdir). (nssobjdir): New variable. * Makerules: Move shared library building before objects rules, so versions are known before extra-lib.mk gets included. * extra-lib.mk (lib-noranlib): Depend on the shared object too. * pwd/getpwuid.c: Rewritten using nss. * pwd/getpwnam.c: Likewise. * pwd/getpwent.c: Likewise. * grp/getgrnam.c: Likewise. * grp/getgrgid.c: Likewise. * grp/getgrent.c: Likewise. * pwd/Makefile (routines): Add getpwent_r, getpwnam_r, getpwuid_r. * pwd/getpwent_r.c: New file. * pwd/getpwnam_r.c: New file. * pwd/getpwuid_r.c: New file. * grp/Makefile (routines): Add getgrent_r, getgrgid_r, getgrnam_r. * grp/getgrnam_r.c: New file. * grp/getgrgid_r.c: New file. * grp/getgrent_r.c: New file. * grp/Makefile (routines): Remove grpopen, grpread. * pwd/Makefile (routines): Remove pwdopen, pwdread. * grp/grpopen.c, grp/grpread.c, pwd/pwdopen.c, pwd/pwdread.c: Removed. * pwd/fgetpwent.c: Rewritten using files-parse.c. * grp/fgetgrent.c: Likewise. * nss/Makefile (routines): Add grp-lookup and pwd-lookup. * nss/pwd-lookup.c, nss/grp-lookup.c: New files. * nss/nss_files/files-grp.c: New file. * nss/nss_files/files-pwd.c: New file. * nss/Makefile (subdir-dirs): New variable; use it in vpath. * nss/nss_files/files-parse.c: New file. * nss/nss_files/files-XXX.c: New file. * nss/nss_files/files-hosts.c, nss/nss_files/files-proto.c, nss/nss_files/files-service.c, nss/nss_files/files-network.c: Rewritten using them. * nss/Makefile (libnss_files-routines): Remove files-host. Add files-hosts, files-grp, files-pwd. * nss/nss_dns/dns-network.c: Don't include . Mon Jun 24 22:39:12 1996 Richard Henderson * sysdeps/alpha/dl-machine.h (ELF_MACHINE_RUNTIME_TRAMPOLINE): A .plt entry now loads the .rela.plt offset directly rather than making us calculate it. Sun Jun 23 15:24:05 1996 Roland McGrath * time/Makefile ($(installed-localtime-file) rule): Do $(make-target-directory) first. * resolv.h: Fix wrapper for resolv/resolv.h. * configure.in (ld --no-whole-archive check): Use AC_TRY_COMMAND. Compile dummy file and pass -nostdlib -nostartfiles so as not to require installed libraries. * shlib-versions (*-*-*): Set libresolv=2, libnss_files=1, libnss_dns=1. Sun Jun 23 19:42:05 1996 Ulrich Drepper * resolv/netdb.h (_PATH_NSSWITCH_CONF): New macro. * inet/herrno.c: New file. * resolv/res_init.c: Remove res_hconf calls. * nss/Makefile, nss/XXX-lookup.c, nss/file-lookup.c, nss/getXXbyYY.c, nss/getXXbyYY_r.c, nss/getXXent.c, nss/getXXent_r.c, nss/host-lookup.c, nss/network-lookup.c, nss/nsswitch.c, nss/nsswitch.h, nss/proto-lookup.c, nss/service-lookup.c: New files. Implementation of name service switch, following the approach in Solaris. Interface specification and general structure inspired by Peter Eriksson . * nss/nss_files/files-host.c, nss/nss_files/files-network.c, nss/nss_files/files-proto.c, nss/nss_files/files-service.c: Implementation of libnss_files.so module for file based databases in NSS service. * nss/nss_dns/dns-host.c, nss/nss_dns/dns-network.c: Implementation if libnss_dns.so module for DNS name lookup in NSS service. * inet/getproto.c, inet/getprtent.c, inet/getprtname.c, inet/getservent.c, inet/getsrvbynm.c, inet/getsrvbypt.c: Changed to serve as interface to NSS. * inet/gethstbyad.c, inet/gethstbyad_r.c, inet/gethstbynm.c, inet/gethstbynm2.c, inet/gethstbynm2_r.c, inet/gethstbynm_r.c, inet/gethstent.c, inet/gethstent_r.c, inet/getnetbynm.c, inet/getnetbynm_r.c, inet/getnetbypt.c, inet/getnetbypt_r.c, inet/getnetent.c, inet/getnetent_r.c, inet/getproto_r.c, inet/getprtent_r.c, inet/getprtname_r.c, inet/getservent_r.c, inet/getsrvbynm_r.c, inet/getsrvbypt_r.c: New files. Implement interfaces to NSS, including reentrant functions. * resolv/getnetbyaddr.c, resolv/getnetbyname.c, resolv/getnetent.c, resolv/sethostent.c: Removed: Obsoleted by NSS. * resolv/mapv4v6addr.h, resolv/mapv4v6hostent.h: Extracted from gethnamaddr.c. These private functions are now used in more than one file. * resolv/inet_pton.c, resolv/gethnamaddr.c: Updated to bind-4.9.4-T5B. Sat Jun 22 16:49:47 1996 Andreas Schwab * rpm/Makefile ($(config)): Make sure the word list in the for loop is syntactically non-empty. --- ChangeLog | 150 +++++++++++ Makeconfig | 3 +- Makefile | 2 +- Makerules | 130 ++++----- NEWS | 11 +- configure | 7 +- configure.in | 7 +- elf/dl-load.c | 7 +- extra-lib.mk | 3 + grp/Makefile | 7 +- grp/fgetgrent.c | 50 +++- grp/getgrent.c | 59 +--- grp/getgrent_r.c | 30 +++ grp/getgrgid.c | 30 +-- grp/getgrgid_r.c | 30 +++ grp/getgrnam.c | 30 +-- grp/getgrnam_r.c | 29 ++ grp/grpopen.c | 28 -- grp/grpread.c | 166 ------------ inet/Makefile | 15 +- inet/gethstbyad.c | 31 +++ inet/gethstbyad_r.c | 31 +++ inet/gethstbynm.c | 31 +++ inet/gethstbynm2.c | 31 +++ inet/gethstbynm2_r.c | 30 +++ inet/gethstbynm_r.c | 31 +++ inet/gethstent.c | 27 ++ inet/gethstent_r.c | 32 +++ inet/getnetbynm.c | 30 +++ inet/getnetbynm_r.c | 30 +++ inet/getnetbypt.c | 30 +++ inet/getnetbypt_r.c | 30 +++ inet/getnetent.c | 26 ++ inet/getnetent_r.c | 31 +++ inet/getproto.c | 73 ++--- inet/getproto_r.c | 29 ++ inet/getprtent.c | 131 ++------- inet/getprtent_r.c | 30 +++ inet/getprtname.c | 80 ++---- inet/getprtname_r.c | 29 ++ inet/getrpcbyname.c | 30 +++ inet/getrpcbyname_r.c | 29 ++ inet/getrpcbynumber.c | 29 ++ inet/getrpcbynumber_r.c | 29 ++ inet/getrpcent.c | 26 ++ inet/getrpcent_r.c | 26 ++ inet/getservent.c | 133 ++------- inet/getservent_r.c | 30 +++ inet/getsrvbynm.c | 83 ++---- inet/getsrvbynm_r.c | 29 ++ inet/getsrvbypt.c | 78 ++---- inet/getsrvbypt_r.c | 29 ++ inet/herrno.c | 22 ++ nss/Makefile | 57 ++++ nss/XXX-lookup.c | 51 ++++ nss/file-lookup.c | 22 ++ nss/getXXbyYY.c | 71 +++++ nss/getXXbyYY_r.c | 129 +++++++++ nss/getXXent.c | 63 +++++ nss/getXXent_r.c | 222 +++++++++++++++ nss/grp-lookup.c | 22 ++ nss/host-lookup.c | 22 ++ nss/network-lookup.c | 22 ++ nss/nss_dns/dns-host.c | 611 ++++++++++++++++++++++++++++++++++++++++++ nss/nss_dns/dns-network.c | 338 +++++++++++++++++++++++ nss/nss_files/files-XXX.c | 221 +++++++++++++++ nss/nss_files/files-grp.c | 49 ++++ nss/nss_files/files-hosts.c | 111 ++++++++ nss/nss_files/files-network.c | 54 ++++ nss/nss_files/files-parse.c | 171 ++++++++++++ nss/nss_files/files-proto.c | 48 ++++ nss/nss_files/files-pwd.c | 54 ++++ nss/nss_files/files-rpc.c | 48 ++++ nss/nss_files/files-service.c | 51 ++++ nss/nsswitch.c | 588 ++++++++++++++++++++++++++++++++++++++++ nss/nsswitch.h | 138 ++++++++++ nss/proto-lookup.c | 22 ++ nss/pwd-lookup.c | 22 ++ nss/rpc-lookup.c | 22 ++ nss/service-lookup.c | 22 ++ posix/getopt.c | 2 +- posix/regex.c | 4 +- pwd/Makefile | 6 +- pwd/fgetpwent.c | 53 +++- pwd/getpwent.c | 59 +--- pwd/getpwent_r.c | 30 +++ pwd/getpwnam.c | 30 +-- pwd/getpwnam_r.c | 30 +++ pwd/getpwuid.c | 30 +-- pwd/getpwuid_r.c | 30 +++ pwd/pwdopen.c | 28 -- pwd/pwdread.c | 147 ---------- resolv.h | 2 +- resolv/gethnamaddr.c | 502 ++++++---------------------------- resolv/getnetbyaddr.c | 57 ---- resolv/getnetbyname.c | 64 ----- resolv/getnetent.c | 162 ----------- resolv/inet_pton.c | 2 +- resolv/mapv4v6addr.h | 75 ++++++ resolv/mapv4v6hostent.h | 90 +++++++ resolv/netdb.h | 11 +- resolv/res_init.c | 4 - resolv/sethostent.c | 62 ----- rpm/Makefile | 6 +- shlib-versions | 10 + sunrpc/Makefile | 4 +- sunrpc/getrpcent.c | 217 --------------- sysdeps/alpha/dl-machine.h | 6 +- time/Makefile | 1 + 109 files changed, 5045 insertions(+), 2090 deletions(-) create mode 100644 grp/getgrent_r.c create mode 100644 grp/getgrgid_r.c create mode 100644 grp/getgrnam_r.c delete mode 100644 grp/grpopen.c delete mode 100644 grp/grpread.c create mode 100644 inet/gethstbyad.c create mode 100644 inet/gethstbyad_r.c create mode 100644 inet/gethstbynm.c create mode 100644 inet/gethstbynm2.c create mode 100644 inet/gethstbynm2_r.c create mode 100644 inet/gethstbynm_r.c create mode 100644 inet/gethstent.c create mode 100644 inet/gethstent_r.c create mode 100644 inet/getnetbynm.c create mode 100644 inet/getnetbynm_r.c create mode 100644 inet/getnetbypt.c create mode 100644 inet/getnetbypt_r.c create mode 100644 inet/getnetent.c create mode 100644 inet/getnetent_r.c create mode 100644 inet/getproto_r.c create mode 100644 inet/getprtent_r.c create mode 100644 inet/getprtname_r.c create mode 100644 inet/getrpcbyname.c create mode 100644 inet/getrpcbyname_r.c create mode 100644 inet/getrpcbynumber.c create mode 100644 inet/getrpcbynumber_r.c create mode 100644 inet/getrpcent.c create mode 100644 inet/getrpcent_r.c create mode 100644 inet/getservent_r.c create mode 100644 inet/getsrvbynm_r.c create mode 100644 inet/getsrvbypt_r.c create mode 100644 inet/herrno.c create mode 100644 nss/Makefile create mode 100644 nss/XXX-lookup.c create mode 100644 nss/file-lookup.c create mode 100644 nss/getXXbyYY.c create mode 100644 nss/getXXbyYY_r.c create mode 100644 nss/getXXent.c create mode 100644 nss/getXXent_r.c create mode 100644 nss/grp-lookup.c create mode 100644 nss/host-lookup.c create mode 100644 nss/network-lookup.c create mode 100644 nss/nss_dns/dns-host.c create mode 100644 nss/nss_dns/dns-network.c create mode 100644 nss/nss_files/files-XXX.c create mode 100644 nss/nss_files/files-grp.c create mode 100644 nss/nss_files/files-hosts.c create mode 100644 nss/nss_files/files-network.c create mode 100644 nss/nss_files/files-parse.c create mode 100644 nss/nss_files/files-proto.c create mode 100644 nss/nss_files/files-pwd.c create mode 100644 nss/nss_files/files-rpc.c create mode 100644 nss/nss_files/files-service.c create mode 100644 nss/nsswitch.c create mode 100644 nss/nsswitch.h create mode 100644 nss/proto-lookup.c create mode 100644 nss/pwd-lookup.c create mode 100644 nss/rpc-lookup.c create mode 100644 nss/service-lookup.c create mode 100644 pwd/getpwent_r.c create mode 100644 pwd/getpwnam_r.c create mode 100644 pwd/getpwuid_r.c delete mode 100644 pwd/pwdopen.c delete mode 100644 pwd/pwdread.c delete mode 100644 resolv/getnetbyaddr.c delete mode 100644 resolv/getnetbyname.c delete mode 100644 resolv/getnetent.c create mode 100644 resolv/mapv4v6addr.h create mode 100644 resolv/mapv4v6hostent.h delete mode 100644 resolv/sethostent.c delete mode 100644 sunrpc/getrpcent.c diff --git a/ChangeLog b/ChangeLog index 2459342127..2721aa9244 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,153 @@ +Tue Jun 25 02:59:11 1996 Roland McGrath + + * malloc/malloc.h: Declare malloc_object_allocated_size, malloc_walk. + * malloc/Makefile (dist-routines): Add malloc-size, malloc-walk. + * malloc/malloc-size.c: New file. + * malloc/malloc-walk.c: New file. + + * malloc/malloc-find.c (malloc_find_object_address): Return null if + PTR is outside the heap. + + * elf/dl-load.c (_dl_map_object): If the requested name matches the + soname of a loaded object, use that object. + +Mon Jun 24 19:57:01 1996 Roland McGrath + + * Makefile (subdirs): Add nss. + + * inet/Makefile (routines): Add getrpcent, getrpcbyname, + getrpcbynumber, getrpcent_r, getrpcbyname_r, getrpcbynumber_r. + * inet/getrpcbynumber_r.c: New file. + * inet/getrpcbynumber.c: New file. + * inet/getrpcbyname.c: New file. + * inet/getrpcbyname_r.c: New file. + * inet/getrpcent_r.c: New file. + * inet/getrpcent.c: New file. + * nss/rpc-lookup.c: New file. + * nss/nss_files/files-rpc.c: New file. + * nss/Makefile (routines): Add rpc-lookup. + (libnss_files-routines): Add files-rpc. + * sunrpc/Makefile (routines): Remove getrpcent. + * sunrpc/getrpcent.c: File removed. + + * nss/getXXent_r.c (REENTRANT_GETNAME): Clear NO_MORE when NIP is + non-null on entry. + + * Makeconfig (rpath-link): Add $(nssobjdir). + (nssobjdir): New variable. + + * Makerules: Move shared library building before objects rules, so + versions are known before extra-lib.mk gets included. + * extra-lib.mk (lib-noranlib): Depend on the shared object too. + + * pwd/getpwuid.c: Rewritten using nss. + * pwd/getpwnam.c: Likewise. + * pwd/getpwent.c: Likewise. + * grp/getgrnam.c: Likewise. + * grp/getgrgid.c: Likewise. + * grp/getgrent.c: Likewise. + * pwd/Makefile (routines): Add getpwent_r, getpwnam_r, getpwuid_r. + * pwd/getpwent_r.c: New file. + * pwd/getpwnam_r.c: New file. + * pwd/getpwuid_r.c: New file. + * grp/Makefile (routines): Add getgrent_r, getgrgid_r, getgrnam_r. + * grp/getgrnam_r.c: New file. + * grp/getgrgid_r.c: New file. + * grp/getgrent_r.c: New file. + * grp/Makefile (routines): Remove grpopen, grpread. + * pwd/Makefile (routines): Remove pwdopen, pwdread. + * grp/grpopen.c, grp/grpread.c, pwd/pwdopen.c, pwd/pwdread.c: Removed. + + * pwd/fgetpwent.c: Rewritten using files-parse.c. + * grp/fgetgrent.c: Likewise. + + * nss/Makefile (routines): Add grp-lookup and pwd-lookup. + * nss/pwd-lookup.c, nss/grp-lookup.c: New files. + * nss/nss_files/files-grp.c: New file. + * nss/nss_files/files-pwd.c: New file. + + * nss/Makefile (subdir-dirs): New variable; use it in vpath. + + * nss/nss_files/files-parse.c: New file. + * nss/nss_files/files-XXX.c: New file. + * nss/nss_files/files-hosts.c, nss/nss_files/files-proto.c, + nss/nss_files/files-service.c, nss/nss_files/files-network.c: + Rewritten using them. + + * nss/Makefile (libnss_files-routines): Remove files-host. + Add files-hosts, files-grp, files-pwd. + + * nss/nss_dns/dns-network.c: Don't include . + +Mon Jun 24 22:39:12 1996 Richard Henderson + + * sysdeps/alpha/dl-machine.h (ELF_MACHINE_RUNTIME_TRAMPOLINE): + A .plt entry now loads the .rela.plt offset directly rather + than making us calculate it. + +Sun Jun 23 15:24:05 1996 Roland McGrath + + * time/Makefile ($(installed-localtime-file) rule): Do + $(make-target-directory) first. + + * resolv.h: Fix wrapper for resolv/resolv.h. + + * configure.in (ld --no-whole-archive check): Use AC_TRY_COMMAND. + Compile dummy file and pass -nostdlib -nostartfiles so as not to + require installed libraries. + + * shlib-versions (*-*-*): Set libresolv=2, libnss_files=1, + libnss_dns=1. + +Sun Jun 23 19:42:05 1996 Ulrich Drepper + + * resolv/netdb.h (_PATH_NSSWITCH_CONF): New macro. + + * inet/herrno.c: New file. + + * resolv/res_init.c: Remove res_hconf calls. + + * nss/Makefile, nss/XXX-lookup.c, nss/file-lookup.c, + nss/getXXbyYY.c, nss/getXXbyYY_r.c, nss/getXXent.c, + nss/getXXent_r.c, nss/host-lookup.c, nss/network-lookup.c, + nss/nsswitch.c, nss/nsswitch.h, nss/proto-lookup.c, + nss/service-lookup.c: New files. Implementation of name + service switch, following the approach in Solaris. + Interface specification and general structure inspired by Peter + Eriksson . + * nss/nss_files/files-host.c, nss/nss_files/files-network.c, + nss/nss_files/files-proto.c, nss/nss_files/files-service.c: + Implementation of libnss_files.so module for file based databases + in NSS service. + * nss/nss_dns/dns-host.c, nss/nss_dns/dns-network.c: Implementation + if libnss_dns.so module for DNS name lookup in NSS service. + + * inet/getproto.c, inet/getprtent.c, inet/getprtname.c, + inet/getservent.c, inet/getsrvbynm.c, inet/getsrvbypt.c: + Changed to serve as interface to NSS. + * inet/gethstbyad.c, inet/gethstbyad_r.c, inet/gethstbynm.c, + inet/gethstbynm2.c, inet/gethstbynm2_r.c, inet/gethstbynm_r.c, + inet/gethstent.c, inet/gethstent_r.c, inet/getnetbynm.c, + inet/getnetbynm_r.c, inet/getnetbypt.c, inet/getnetbypt_r.c, + inet/getnetent.c, inet/getnetent_r.c, inet/getproto_r.c, + inet/getprtent_r.c, inet/getprtname_r.c, inet/getservent_r.c, + inet/getsrvbynm_r.c, inet/getsrvbypt_r.c: New files. Implement + interfaces to NSS, including reentrant functions. + + * resolv/getnetbyaddr.c, resolv/getnetbyname.c, resolv/getnetent.c, + resolv/sethostent.c: Removed: Obsoleted by NSS. + + * resolv/mapv4v6addr.h, resolv/mapv4v6hostent.h: Extracted from + gethnamaddr.c. These private functions are now used in more + than one file. + + * resolv/inet_pton.c, resolv/gethnamaddr.c: Updated to bind-4.9.4-T5B. + +Sat Jun 22 16:49:47 1996 Andreas Schwab + + * rpm/Makefile ($(config)): Make sure the word list in the for + loop is syntactically non-empty. + Sat Jun 22 21:29:52 1996 Roland McGrath * Version 1.92 test release. diff --git a/Makeconfig b/Makeconfig index 3d7989086d..eeeb9ac53f 100644 --- a/Makeconfig +++ b/Makeconfig @@ -324,7 +324,8 @@ else default-rpath = $(libdir) endif # This is how to find at build-time things that will be installed there. -rpath-link = $(common-objdir):$(elfobjdir) +rpath-link = $(common-objdir):$(elfobjdir):$(nssobjdir) +nssobjdir := $(firstword $(objdir) $(patsubst ../$(subdir),.,$(..)nss)) else link-libc = $(common-objpfx)libc.a $(gnulib) $(common-objpfx)libc.a endif diff --git a/Makefile b/Makefile index 39c812cc50..13ca36bdb5 100644 --- a/Makefile +++ b/Makefile @@ -54,7 +54,7 @@ endif subdirs = csu assert ctype db locale intl catgets math setjmp signal stdlib \ stdio-common $(stdio) malloc string wcsmbs time dirent grp pwd\ posix io termios resource misc login socket sysvipc gmon gnulib \ - wctype $(wildcard crypt) manual $(sysdep-subdirs) elf po + wctype $(wildcard crypt) manual $(sysdep-subdirs) nss elf po export subdirs := $(subdirs) # Benign, useless in GNU make before 3.63. # The mach and hurd subdirectories have many generated header files which diff --git a/Makerules b/Makerules index 7f4b5fd16e..84afdd53a9 100644 --- a/Makerules +++ b/Makerules @@ -286,6 +286,71 @@ define sed-remove-objpfx endef endif +# Shared library building. + +ifeq (yes,$(build-shared)) + +# Process the shlib-versions file, which tells us what shared library +# version numbers to use when we install shared objects on this system. +-include $(common-objpfx)soversions.mk +$(common-objpfx)soversions.mk: $(..)shlib-versions $(..)Makerules \ + $(common-objpfx)config.make + sed 's/#.*$$//' $< | while read conf versions; do \ + test -n "$$versions" || continue; \ + case '$(config-machine)-$(config-vendor)-$(config-os)' in $$conf)\ + for v in $$versions; do \ + lib="$${v%%=*}"; if eval "test -z \"\$$vers_lib$$lib\""; then \ + eval vers_lib$${lib}=yes; \ + echo $$lib.so-version=.$${v##$$lib=}; fi; \ + done ;; esac; done > $@T + mv -f $@T $@ + +# Get $(version) defined with the release version number. +-include $(common-objpfx)version.mk + + +# Pattern rule to build a shared object from an archive of PIC objects. +# This must come after the installation rules so Make doesn't try to +# build shared libraries in place from the installed *_pic.a files. +# $(LDLIBS-%.so) may contain -l switches to generate run-time dependencies +# on other shared objects. +lib%.so: lib%_pic.a; $(build-shlib) + +ifeq ($(have-no-whole-archive),yes) +no-whole-archive = -Wl,--no-whole-archive +else +no-whole-archive = +endif + +define build-shlib +$(LINK.o) -shared -o $@ $(sysdep-LDFLAGS) $(config-LDFLAGS) \ + -Wl,-soname=lib$(libprefix)$(@F:lib%.so=%).so$($(@F)-version) \ + $(LDFLAGS.so) $(LDFLAGS-$(@F:lib%.so=%).so) \ + -L$(subst :, -L,$(rpath-link)) -Wl,-rpath-link=$(rpath-link) \ + -Wl,--whole-archive $^ $(no-whole-archive) \ + $(LDLIBS-$(@F:lib%.so=%).so) +endef + +# Don't try to use -lc when making libc.so itself. +# Also omits crti.o and crtn.o, which we do not want +# since we define our own `.init' section specially. +LDFLAGS-c.so = -nostdlib -nostartfiles +# Give libc.so an entry point and make it directly runnable itself. +LDFLAGS-c.so += -e __libc_main +# Use our own special initializer and finalizer files for libc.so. +elfobjdir := $(firstword $(objdir) $(patsubst ../$(subdir),.,$(..)elf)) +$(common-objpfx)libc.so: $(elfobjdir)/soinit.so \ + $(common-objpfx)libc_pic.a \ + $(elfobjdir)/sofini.so $(elfobjdir)/ld.so + $(build-shlib) + +ifdef libc.so-version +$(common-objpfx)libc.so$(libc.so-version): $(common-objpfx)libc.so + rm -f $@ + ln -s $( $@T - mv -f $@T $@ - -# Get $(version) defined with the release version number. --include $(common-objpfx)version.mk - - -# Pattern rule to build a shared object from an archive of PIC objects. -# This must come after the installation rules so Make doesn't try to -# build shared libraries in place from the installed *_pic.a files. -# $(LDLIBS-%.so) may contain -l switches to generate run-time dependencies -# on other shared objects. -lib%.so: lib%_pic.a; $(build-shlib) - -ifeq ($(have-no-whole-archive),yes) -no-whole-archive = -Wl,--no-whole-archive -else -no-whole-archive = -endif - -define build-shlib -$(LINK.o) -shared -o $@ $(sysdep-LDFLAGS) $(config-LDFLAGS) \ - -Wl,-soname=lib$(libprefix)$(@F:lib%.so=%).so$($(@F)-version) \ - $(LDFLAGS.so) $(LDFLAGS-$(@F:lib%.so=%).so) \ - -L$(subst :, -L,$(rpath-link)) -Wl,-rpath-link=$(rpath-link) \ - -Wl,--whole-archive $^ $(no-whole-archive) \ - $(LDLIBS-$(@F:lib%.so=%).so) -endef - -# Don't try to use -lc when making libc.so itself. -# Also omits crti.o and crtn.o, which we do not want -# since we define our own `.init' section specially. -LDFLAGS-c.so = -nostdlib -nostartfiles -# Give libc.so an entry point and make it directly runnable itself. -LDFLAGS-c.so += -e __libc_main -# Use our own special initializer and finalizer files for libc.so. -elfobjdir := $(firstword $(objdir) $(patsubst ../$(subdir),.,$(..)elf)) -$(common-objpfx)libc.so: $(elfobjdir)/soinit.so \ - $(common-objpfx)libc_pic.a \ - $(elfobjdir)/sofini.so $(elfobjdir)/ld.so - $(build-shlib) - -ifdef libc.so-version -$(common-objpfx)libc.so$(libc.so-version): $(common-objpfx)libc.so - rm -f $@ - ln -s $(&6 else cat > conftest.c <<\EOF -main () { exit (0); } +_start () {} EOF -if ${CC-cc} $CFLAGS -Wl,--no-whole-archive \ - -o conftest conftest.c 2>/dev/null; then +if { ac_try='${CC-cc} $CFLAGS \ + -nostdlib -nostartfiles -Wl,--no-whole-archive \ + -o conftest conftest.c'; { (eval echo configure:1549: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then libc_cv_ld_no_whole_archive=yes else libc_cv_ld_no_whole_archive=no diff --git a/configure.in b/configure.in index 610d5e84fb..46d7317d4f 100644 --- a/configure.in +++ b/configure.in @@ -475,10 +475,11 @@ fi AC_CACHE_CHECK(for ld --no-whole-archive, libc_cv_ld_no_whole_archive, [dnl cat > conftest.c <<\EOF -main () { exit (0); } +_start () {} EOF -if ${CC-cc} $CFLAGS -Wl,--no-whole-archive \ - -o conftest conftest.c 2>/dev/null; then +if AC_TRY_COMMAND([${CC-cc} $CFLAGS \ + -nostdlib -nostartfiles -Wl,--no-whole-archive \ + -o conftest conftest.c]); then libc_cv_ld_no_whole_archive=yes else libc_cv_ld_no_whole_archive=no diff --git a/elf/dl-load.c b/elf/dl-load.c index 1e0db77c55..7c2f2e3985 100644 --- a/elf/dl-load.c +++ b/elf/dl-load.c @@ -459,7 +459,12 @@ _dl_map_object (struct link_map *loader, const char *name, int type) /* Look for this name among those already loaded. */ for (l = _dl_loaded; l; l = l->l_next) - if (! strcmp (name, l->l_libname)) + if (! strcmp (name, l->l_libname) || /* NAME was requested before. */ + /* If the requested name matches the soname of a loaded object, + use that object. */ + (l->l_info[DT_SONAME] && + ! strcmp (name, (const char *) (l->addr + + l->l_info[DT_SONAME]->d_un.d_ptr)))) { /* The object is already loaded. Just bump its reference count and return it. */ diff --git a/extra-lib.mk b/extra-lib.mk index 283da06b93..5368a03481 100644 --- a/extra-lib.mk +++ b/extra-lib.mk @@ -27,6 +27,9 @@ alltypes-$(lib) := $(foreach o,$(object-suffixes-$(lib)),\ ifeq (,$($(lib)-no-lib-dep)) lib-noranlib: $(alltypes-$(lib)) +ifeq (yes,$(build-shared)) +lib-noranlib: $(objpfx)$(lib).so$($(lib).so-version) +endif else others: $(alltypes-$(lib)) endif diff --git a/grp/Makefile b/grp/Makefile index 6444aab5ff..273b7d17ea 100644 --- a/grp/Makefile +++ b/grp/Makefile @@ -1,4 +1,4 @@ -# Copyright (C) 1991, 1992 Free Software Foundation, Inc. +# Copyright (C) 1991, 1992, 1996 Free Software Foundation, Inc. # This file is part of the GNU C Library. # The GNU C Library is free software; you can redistribute it and/or @@ -21,8 +21,9 @@ # subdir := grp -routines := grpopen grpread fgetgrent getgrent getgrgid getgrnam \ - initgroups setgroups +routines := fgetgrent initgroups setgroups \ + getgrent getgrgid getgrnam \ + getgrent_r getgrgid_r getgrnam_r tests := testgrp diff --git a/grp/fgetgrent.c b/grp/fgetgrent.c index bef3e3f745..031ccb9c92 100644 --- a/grp/fgetgrent.c +++ b/grp/fgetgrent.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,26 +16,48 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include -#include -#include #include -#include -#include #include +/* Define a line parsing function using the common code + used in the nss_files module. */ -/* Read a group entry from STREAM. */ +#define STRUCTURE group +#define ENTNAME grent +struct grent_data {}; + +#define TRAILING_LIST_MEMBER gr_mem +#define TRAILING_LIST_SEPARATOR_P(c) ((c) == ',') +#include "../nss/nss_files/files-parse.c" +LINE_PARSER +( + STRING_FIELD (result->gr_name, ISCOLON); + STRING_FIELD (result->gr_passwd, ISCOLON); + INT_FIELD (result->gr_gid, ISCOLON, 10,); +) + + +/* Read one entry from the given stream. */ struct group * -DEFUN(fgetgrent, (stream), FILE *stream) +fgetgrent (FILE *stream) { - static PTR info = NULL; - if (info == NULL) + static char buffer[BUFSIZ]; + static struct group result; + char *p; + + do { - info = __grpalloc(); - if (info == NULL) + p = fgets (buffer, sizeof buffer, stream); + if (p == NULL) return NULL; - } - return __grpread(stream, info); + /* Skip leading blanks. */ + while (isspace (*p)) + ++p; + } while (*p == '\0' || *p == '#' || /* Ignore empty and comment lines. */ + /* Parse the line. If it is invalid, loop to + get the next line of the file to parse. */ + ! parse_line (p, &result, (void *) buffer, sizeof buffer)); + + return &result; } diff --git a/grp/getgrent.c b/grp/getgrent.c index 105572f9a0..4e14bbcf17 100644 --- a/grp/getgrent.c +++ b/grp/getgrent.c @@ -1,5 +1,6 @@ -/* Copyright (C) 1991 Free Software Foundation, Inc. +/* Copyright (C) 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. +Contributed by Ulrich Drepper , 1996. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as @@ -13,55 +14,17 @@ Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ -#include -#include -#include #include -static FILE *stream = NULL; -/* Rewind the stream. */ -void -DEFUN_VOID(setgrent) -{ - if (stream != NULL) - rewind(stream); -} +#define LOOKUP_TYPE struct group +#define SETFUNC_NAME setgrent +#define GETFUNC_NAME getgrent +#define ENDFUNC_NAME endgrent +#define DATABASE_NAME group +#define BUFLEN 1024 - -/* Close the stream. */ -void -DEFUN_VOID(endgrent) -{ - if (stream != NULL) - { - (void) fclose(stream); - stream = NULL; - } -} - - -/* Read an entry from the stream. */ -struct group * -DEFUN_VOID(getgrent) -{ - static PTR info = NULL; - if (info == NULL) - { - info = __grpalloc(); - if (info == NULL) - return(NULL); - } - - if (stream == NULL) - { - stream = __grpopen(); - if (stream == NULL) - return(NULL); - } - - return(__grpread(stream, info)); -} +#include "../nss/getXXent.c" diff --git a/grp/getgrent_r.c b/grp/getgrent_r.c new file mode 100644 index 0000000000..db692b20d6 --- /dev/null +++ b/grp/getgrent_r.c @@ -0,0 +1,30 @@ +/* Copyright (C) 1996 Free Software Foundation, Inc. +This file is part of the GNU C Library. +Contributed by Ulrich Drepper , 1996. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public License as +published by the Free Software Foundation; either version 2 of the +License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with the GNU C Library; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#include + + +#define LOOKUP_TYPE struct group +#define SETFUNC_NAME setgrent +#define GETFUNC_NAME getgrent +#define ENDFUNC_NAME endgrent +#define DATABASE_NAME group +#define BUFLEN 1024 + +#include "../nss/getXXent_r.c" diff --git a/grp/getgrgid.c b/grp/getgrgid.c index ef3860fe40..855d31cbe9 100644 --- a/grp/getgrgid.c +++ b/grp/getgrgid.c @@ -1,5 +1,6 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. +Contributed by Ulrich Drepper , 1996. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as @@ -13,24 +14,17 @@ Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ -#include -#include -#include -#include #include -/* Search for an entry with a matching group ID. */ -struct group * -DEFUN(getgrgid, (gid), gid_t gid) -{ - int match (struct group *p) - { - return p->gr_gid == gid; - } - static void *info; - return __grpscan (&info, &match); -} +#define LOOKUP_TYPE struct group +#define FUNCTION_NAME getgrgid +#define DATABASE_NAME group +#define ADD_PARAMS gid_t gid +#define ADD_VARIABLES gid +#define BUFLEN 1024 + +#include "../nss/getXXbyYY.c" diff --git a/grp/getgrgid_r.c b/grp/getgrgid_r.c new file mode 100644 index 0000000000..1d5f1a4313 --- /dev/null +++ b/grp/getgrgid_r.c @@ -0,0 +1,30 @@ +/* Copyright (C) 1996 Free Software Foundation, Inc. +This file is part of the GNU C Library. +Contributed by Ulrich Drepper , 1996. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public License as +published by the Free Software Foundation; either version 2 of the +License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with the GNU C Library; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#include + + +#define LOOKUP_TYPE struct passwd +#define FUNCTION_NAME getgrgid +#define DATABASE_NAME group +#define ADD_PARAMS gid_t gid +#define ADD_VARIABLES gid +#define BUFLEN 1024 + +#include "../nss/getXXbyYY_r.c" diff --git a/grp/getgrnam.c b/grp/getgrnam.c index 841677070d..2104d87459 100644 --- a/grp/getgrnam.c +++ b/grp/getgrnam.c @@ -1,5 +1,6 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. +Contributed by Ulrich Drepper , 1996. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as @@ -13,24 +14,17 @@ Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ -#include -#include -#include -#include #include -/* Search for an entry with a matching name. */ -struct group * -DEFUN(getgrnam, (name), const char *name) -{ - int match (struct group *p) - { - return ! strcmp (name, p->gr_name); - } - static void *info; - return __grpscan (&info, &match); -} +#define LOOKUP_TYPE struct group +#define FUNCTION_NAME getgrnam +#define DATABASE_NAME group +#define ADD_PARAMS const char *name +#define ADD_VARIABLES name +#define BUFLEN 1024 + +#include "../nss/getXXbyYY.c" diff --git a/grp/getgrnam_r.c b/grp/getgrnam_r.c new file mode 100644 index 0000000000..c1292bb581 --- /dev/null +++ b/grp/getgrnam_r.c @@ -0,0 +1,29 @@ +/* Copyright (C) 1996 Free Software Foundation, Inc. +This file is part of the GNU C Library. +Contributed by Ulrich Drepper , 1996. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public License as +published by the Free Software Foundation; either version 2 of the +License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with the GNU C Library; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#include + + +#define LOOKUP_TYPE struct group +#define FUNCTION_NAME getgrnam +#define DATABASE_NAME group +#define ADD_PARAMS const char *name +#define ADD_VARIABLES name + +#include "../nss/getXXbyYY_r.c" diff --git a/grp/grpopen.c b/grp/grpopen.c deleted file mode 100644 index 77d15979f1..0000000000 --- a/grp/grpopen.c +++ /dev/null @@ -1,28 +0,0 @@ -/* Copyright (C) 1991 Free Software Foundation, Inc. -This file is part of the GNU C Library. - -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. - -The GNU C Library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ - -#include -#include -#include - -/* Return a new stream open on the group file. */ -FILE * -DEFUN_VOID(__grpopen) -{ - return fopen("/etc/group", "r"); -} diff --git a/grp/grpread.c b/grp/grpread.c deleted file mode 100644 index 1fed32f2e3..0000000000 --- a/grp/grpread.c +++ /dev/null @@ -1,166 +0,0 @@ -/* Copyright (C) 1991, 1992, 1995 Free Software Foundation, Inc. -This file is part of the GNU C Library. - -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. - -The GNU C Library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ - -#include -#include -#include -#include -#include -#include -#include -#include - -/* This is the function that all the others are based on. - The format of the group file is known only here. */ - -/* Structure containing info kept by each __grpread caller. */ -typedef struct - { - char *buf; - size_t buflen; - size_t max_members; - char **members; - struct group g; - } grpread_info; - - -/* Return a chunk of memory containing a pre-initialized `grpread_info'. */ -PTR -DEFUN_VOID(__grpalloc) -{ - grpread_info *info = (PTR) malloc (sizeof(grpread_info)); - if (info == NULL) - return NULL; - - info->buf = NULL; - info->buflen = 0; - - info->max_members = 5; - info->members = (char **) malloc (5 * sizeof(char *)); - if (info->members == NULL) - { - free ((PTR) info); - return NULL; - } - - return info; -} - -/* Read a group entry from STREAM, filling in G. */ -struct group * -DEFUN(__grpread, (stream, g), FILE *stream AND PTR CONST g) -{ - register grpread_info *CONST info = (grpread_info *) g; - char *start, *end; - register size_t i; - - /* Idiocy checks. */ - if (stream == NULL) - { - errno = EINVAL; - return NULL; - } - - do - if (__getline (&info->buf, &info->buflen, stream) == -1) - return NULL; - while (info->buf[0] == '#'); - - start = info->buf; - end = strchr (start, ':'); - if (end == NULL) - return NULL; - *end = '\0'; - info->g.gr_name = start; - - start = end + 1; - end = strchr (start, ':'); - if (end == NULL) - return NULL; - *end = '\0'; - info->g.gr_passwd = start; - - info->g.gr_gid = (gid_t) strtol (end + 1, &end, 10); - if (*end != ':') - return NULL; - - i = 0; - do - { - start = end + 1; - end = strchr (start, ','); - if (end == NULL) - { - end = strchr (start, '\n'); - if (end == start) - break; - if (end == NULL) - return NULL; - *end = '\0'; - end = NULL; - } - else - *end = '\0'; - - if (i == info->max_members - 2) - { - info->max_members += 5; - info->members = (char **) - realloc ((PTR) info->members, info->max_members * sizeof (char *)); - if (info->members == NULL) - return NULL; - } - - info->members[i++] = start; - } while (end != NULL); - info->members[i] = NULL; - info->g.gr_mem = info->members; - - return &info->g; -} - - -struct group * -__grpscan (void **info, int (*selector) (struct group *)) -{ - FILE *stream; - struct group *p; - - if (*info == NULL) - { - *info = __grpalloc (); - if (info == NULL) - return NULL; - } - - stream = __grpopen (); - if (stream == NULL) - return NULL; - - p = NULL; - while (! feof (stream)) - { - p = __grpread (stream, *info); - if (p && (*selector) (p)) - break; - p = NULL; - } - - (void) fclose (stream); - return p; -} diff --git a/inet/Makefile b/inet/Makefile index 9389a22338..da300c7376 100644 --- a/inet/Makefile +++ b/inet/Makefile @@ -1,4 +1,4 @@ -# Copyright (C) 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc. +# Copyright (C) 1991, 92, 93, 94, 95, 96 Free Software Foundation, Inc. # This file is part of the GNU C Library. # The GNU C Library is free software; you can redistribute it and/or @@ -25,9 +25,16 @@ headers := netinet/in.h $(wildcard arpa/*.h protocols/*.h) routines := ntohl ntohs htonl htons \ inet_lnaof inet_mkadr \ - inet_netof inet_ntoa inet_net \ - getproto getprtent getprtname \ - getsrvbynm getsrvbypt getservent \ + inet_netof inet_ntoa inet_net herrno \ + gethstbyad gethstbyad_r gethstbynm gethstbynm2 gethstbynm2_r \ + gethstbynm_r gethstent gethstent_r \ + getnetbypt getnetbypt_r getnetbynm getnetent getnetent_r \ + getnetbynm_r \ + getproto getproto_r getprtent getprtent_r getprtname getprtname_r \ + getsrvbynm getsrvbynm_r getsrvbypt getsrvbypt_r getservent \ + getservent_r \ + getrpcent getrpcbyname getrpcbynumber \ + getrpcent_r getrpcbyname_r getrpcbynumber_r \ rcmd rexec ruserpass # No warnings about losing BSD code. diff --git a/inet/gethstbyad.c b/inet/gethstbyad.c new file mode 100644 index 0000000000..abc2eab06d --- /dev/null +++ b/inet/gethstbyad.c @@ -0,0 +1,31 @@ +/* Copyright (C) 1996 Free Software Foundation, Inc. +This file is part of the GNU C Library. +Contributed by Ulrich Drepper , 1996. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public License as +published by the Free Software Foundation; either version 2 of the +License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with the GNU C Library; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#include + + +#define LOOKUP_TYPE struct hostent +#define FUNCTION_NAME gethostbyaddr +#define DATABASE_NAME hosts +#define ADD_PARAMS const char *addr, int len, int type +#define ADD_VARIABLES addr, len, type +#define BUFLEN 1024 +#define NEED_H_ERRNO 1 + +#include "../nss/getXXbyYY.c" diff --git a/inet/gethstbyad_r.c b/inet/gethstbyad_r.c new file mode 100644 index 0000000000..7dce4403d7 --- /dev/null +++ b/inet/gethstbyad_r.c @@ -0,0 +1,31 @@ +/* Copyright (C) 1996 Free Software Foundation, Inc. +This file is part of the GNU C Library. +Contributed by Ulrich Drepper , 1996. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public License as +published by the Free Software Foundation; either version 2 of the +License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with the GNU C Library; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#include + + +#define LOOKUP_TYPE struct hostent +#define FUNCTION_NAME gethostbyaddr +#define DATABASE_NAME hosts +#define ADD_PARAMS const char *addr, int len, int type +#define ADD_VARIABLES addr, len, type +#define NEED_H_ERRNO 1 +#define NEED__RES 1 + +#include "../nss/getXXbyYY_r.c" diff --git a/inet/gethstbynm.c b/inet/gethstbynm.c new file mode 100644 index 0000000000..07178108cf --- /dev/null +++ b/inet/gethstbynm.c @@ -0,0 +1,31 @@ +/* Copyright (C) 1996 Free Software Foundation, Inc. +This file is part of the GNU C Library. +Contributed by Ulrich Drepper , 1996. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public License as +published by the Free Software Foundation; either version 2 of the +License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with the GNU C Library; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#include + + +#define LOOKUP_TYPE struct hostent +#define FUNCTION_NAME gethostbyname +#define DATABASE_NAME hosts +#define ADD_PARAMS const char *name +#define ADD_VARIABLES name +#define BUFLEN 1024 +#define NEED_H_ERRNO 1 + +#include "../nss/getXXbyYY.c" diff --git a/inet/gethstbynm2.c b/inet/gethstbynm2.c new file mode 100644 index 0000000000..42a01d4141 --- /dev/null +++ b/inet/gethstbynm2.c @@ -0,0 +1,31 @@ +/* Copyright (C) 1996 Free Software Foundation, Inc. +This file is part of the GNU C Library. +Contributed by Ulrich Drepper , 1996. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public License as +published by the Free Software Foundation; either version 2 of the +License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with the GNU C Library; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#include + + +#define LOOKUP_TYPE struct hostent +#define FUNCTION_NAME gethostbyname2 +#define DATABASE_NAME hosts +#define ADD_PARAMS const char *name, int af +#define ADD_VARIABLES name, af +#define BUFLEN 1024 +#define NEED_H_ERRNO 1 + +#include "../nss/getXXbyYY.c" diff --git a/inet/gethstbynm2_r.c b/inet/gethstbynm2_r.c new file mode 100644 index 0000000000..a2aee54559 --- /dev/null +++ b/inet/gethstbynm2_r.c @@ -0,0 +1,30 @@ +/* Copyright (C) 1996 Free Software Foundation, Inc. +This file is part of the GNU C Library. +Contributed by Ulrich Drepper , 1996. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public License as +published by the Free Software Foundation; either version 2 of the +License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with the GNU C Library; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#include + + +#define LOOKUP_TYPE struct hostent +#define FUNCTION_NAME gethostbyname2 +#define DATABASE_NAME hosts +#define ADD_PARAMS const char *name, int af +#define ADD_VARIABLES name, af +#define NEED_H_ERRNO 1 + +#include "../nss/getXXbyYY_r.c" diff --git a/inet/gethstbynm_r.c b/inet/gethstbynm_r.c new file mode 100644 index 0000000000..6bd2920e74 --- /dev/null +++ b/inet/gethstbynm_r.c @@ -0,0 +1,31 @@ +/* Copyright (C) 1996 Free Software Foundation, Inc. +This file is part of the GNU C Library. +Contributed by Ulrich Drepper , 1996. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public License as +published by the Free Software Foundation; either version 2 of the +License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with the GNU C Library; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#include + + +#define LOOKUP_TYPE struct hostent +#define FUNCTION_NAME gethostbyname +#define DATABASE_NAME hosts +#define ADD_PARAMS const char *name +#define ADD_VARIABLES name +#define NEED_H_ERRNO 1 +#define NEED__RES 1 + +#include "../nss/getXXbyYY_r.c" diff --git a/inet/gethstent.c b/inet/gethstent.c new file mode 100644 index 0000000000..5c7293683f --- /dev/null +++ b/inet/gethstent.c @@ -0,0 +1,27 @@ +/* Copyright (C) 1996 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public License as +published by the Free Software Foundation; either version 2 of the +License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with the GNU C Library; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#include + + +#define LOOKUP_TYPE struct hostent +#define GETFUNC_NAME gethostent +#define BUFLEN 1024 +#define NEED_H_ERRNO 1 + +#include "../nss/getXXent.c" diff --git a/inet/gethstent_r.c b/inet/gethstent_r.c new file mode 100644 index 0000000000..f07601dfad --- /dev/null +++ b/inet/gethstent_r.c @@ -0,0 +1,32 @@ +/* Copyright (C) 1996 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public License as +published by the Free Software Foundation; either version 2 of the +License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with the GNU C Library; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#include + + +#define LOOKUP_TYPE struct hostent +#define SETFUNC_NAME sethostent +#define GETFUNC_NAME gethostent +#define ENDFUNC_NAME endhostent +#define DATABASE_NAME hosts +#define STAYOPEN int stayopen +#define STAYOPEN_VAR stayopen +#define NEED_H_ERRNO 1 +#define NEED__RES 1 + +#include "../nss/getXXent_r.c" diff --git a/inet/getnetbynm.c b/inet/getnetbynm.c new file mode 100644 index 0000000000..db1c7b0cf6 --- /dev/null +++ b/inet/getnetbynm.c @@ -0,0 +1,30 @@ +/* Copyright (C) 1996 Free Software Foundation, Inc. +This file is part of the GNU C Library. +Contributed by Ulrich Drepper , 1996. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public License as +published by the Free Software Foundation; either version 2 of the +License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with the GNU C Library; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#include + + +#define LOOKUP_TYPE struct netent +#define FUNCTION_NAME getnetbyname +#define DATABASE_NAME networks +#define ADD_PARAMS const char *name +#define ADD_VARIABLES name +#define BUFLEN 1024 + +#include "../nss/getXXbyYY.c" diff --git a/inet/getnetbynm_r.c b/inet/getnetbynm_r.c new file mode 100644 index 0000000000..ba395d63ac --- /dev/null +++ b/inet/getnetbynm_r.c @@ -0,0 +1,30 @@ +/* Copyright (C) 1996 Free Software Foundation, Inc. +This file is part of the GNU C Library. +Contributed by Ulrich Drepper , 1996. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public License as +published by the Free Software Foundation; either version 2 of the +License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with the GNU C Library; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#include + + +#define LOOKUP_TYPE struct netent +#define FUNCTION_NAME getnetbyname +#define DATABASE_NAME networks +#define ADD_PARAMS const char *name +#define ADD_VARIABLES name +#define NEED__RES 1 + +#include "../nss/getXXbyYY_r.c" diff --git a/inet/getnetbypt.c b/inet/getnetbypt.c new file mode 100644 index 0000000000..960ac0a064 --- /dev/null +++ b/inet/getnetbypt.c @@ -0,0 +1,30 @@ +/* Copyright (C) 1996 Free Software Foundation, Inc. +This file is part of the GNU C Library. +Contributed by Ulrich Drepper , 1996. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public License as +published by the Free Software Foundation; either version 2 of the +License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with the GNU C Library; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#include + + +#define LOOKUP_TYPE struct netent +#define FUNCTION_NAME getnetbyport +#define DATABASE_NAME networks +#define ADD_PARAMS unsigned long int net, int type +#define ADD_VARIABLES net, type +#define BUFLEN 1024 + +#include "../nss/getXXbyYY.c" diff --git a/inet/getnetbypt_r.c b/inet/getnetbypt_r.c new file mode 100644 index 0000000000..a39f26f797 --- /dev/null +++ b/inet/getnetbypt_r.c @@ -0,0 +1,30 @@ +/* Copyright (C) 1996 Free Software Foundation, Inc. +This file is part of the GNU C Library. +Contributed by Ulrich Drepper , 1996. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public License as +published by the Free Software Foundation; either version 2 of the +License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with the GNU C Library; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#include + + +#define LOOKUP_TYPE struct netent +#define FUNCTION_NAME getnetbyport +#define DATABASE_NAME networks +#define ADD_PARAMS unsigned long int net, int type +#define ADD_VARIABLES net, type +#define NEED__RES 1 + +#include "../nss/getXXbyYY_r.c" diff --git a/inet/getnetent.c b/inet/getnetent.c new file mode 100644 index 0000000000..207a70ea5e --- /dev/null +++ b/inet/getnetent.c @@ -0,0 +1,26 @@ +/* Copyright (C) 1996 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public License as +published by the Free Software Foundation; either version 2 of the +License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with the GNU C Library; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#include + + +#define LOOKUP_TYPE struct netent +#define GETFUNC_NAME getnetent +#define BUFLEN 1024 + +#include "../nss/getXXent.c" diff --git a/inet/getnetent_r.c b/inet/getnetent_r.c new file mode 100644 index 0000000000..333bb4b529 --- /dev/null +++ b/inet/getnetent_r.c @@ -0,0 +1,31 @@ +/* Copyright (C) 1996 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public License as +published by the Free Software Foundation; either version 2 of the +License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that