gnulib: import netdb

A few sims use this to provide network functionality.
This commit is contained in:
Mike Frysinger
2021-05-29 12:48:49 -04:00
parent c469a50252
commit 172a7ff54b
11 changed files with 570 additions and 15 deletions

View File

@ -1,3 +1,11 @@
2021-06-08 Mike Frysinger <vapier@gentoo.org>
* update-gnulib.sh (IMPORTED_GNULIB_MODULES): Add netdb.
* aclocal.m4, configure, Makefile.in, import/Makefile.am,
import/Makefile.in, import/m4/gnulib-cache.m4,
import/m4/gnulib-comp.m4: Regenerate.
* import/m4/netdb_h.m4, import/netdb.in.h: New files.
2021-06-08 Mike Frysinger <vapier@gentoo.org>
* update-gnulib.sh (IMPORTED_GNULIB_MODULES): Add chown.

View File

@ -210,6 +210,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/depstand.m4 \
$(top_srcdir)/import/m4/msvc-inval.m4 \
$(top_srcdir)/import/m4/msvc-nothrow.m4 \
$(top_srcdir)/import/m4/multiarch.m4 \
$(top_srcdir)/import/m4/netdb_h.m4 \
$(top_srcdir)/import/m4/netinet_in_h.m4 \
$(top_srcdir)/import/m4/nocrash.m4 \
$(top_srcdir)/import/m4/off_t.m4 \
@ -495,6 +496,7 @@ GNULIB_FTELLO = @GNULIB_FTELLO@
GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@
GNULIB_FUTIMENS = @GNULIB_FUTIMENS@
GNULIB_FWRITE = @GNULIB_FWRITE@
GNULIB_GETADDRINFO = @GNULIB_GETADDRINFO@
GNULIB_GETC = @GNULIB_GETC@
GNULIB_GETCHAR = @GNULIB_GETCHAR@
GNULIB_GETCWD = @GNULIB_GETCWD@
@ -900,16 +902,20 @@ HAVE_DECL_FDOPENDIR = @HAVE_DECL_FDOPENDIR@
HAVE_DECL_FLOORF = @HAVE_DECL_FLOORF@
HAVE_DECL_FLOORL = @HAVE_DECL_FLOORL@
HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@
HAVE_DECL_FREEADDRINFO = @HAVE_DECL_FREEADDRINFO@
HAVE_DECL_FREXPL = @HAVE_DECL_FREXPL@
HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@
HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@
HAVE_DECL_GAI_STRERROR = @HAVE_DECL_GAI_STRERROR@
HAVE_DECL_GCVT = @HAVE_DECL_GCVT@
HAVE_DECL_GETADDRINFO = @HAVE_DECL_GETADDRINFO@
HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@
HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@
HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@
HAVE_DECL_GETLOGIN = @HAVE_DECL_GETLOGIN@
HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
HAVE_DECL_GETNAMEINFO = @HAVE_DECL_GETNAMEINFO@
HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@
HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@
HAVE_DECL_IMAXABS = @HAVE_DECL_IMAXABS@
@ -1067,6 +1073,7 @@ HAVE_MODFF = @HAVE_MODFF@
HAVE_MODFL = @HAVE_MODFL@
HAVE_MSVC_INVALID_PARAMETER_HANDLER = @HAVE_MSVC_INVALID_PARAMETER_HANDLER@
HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
HAVE_NETDB_H = @HAVE_NETDB_H@
HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@
HAVE_NEWLOCALE = @HAVE_NEWLOCALE@
HAVE_OPENAT = @HAVE_OPENAT@
@ -1140,6 +1147,7 @@ HAVE_STRTOD = @HAVE_STRTOD@
HAVE_STRTOLD = @HAVE_STRTOLD@
HAVE_STRTOLL = @HAVE_STRTOLL@
HAVE_STRTOULL = @HAVE_STRTOULL@
HAVE_STRUCT_ADDRINFO = @HAVE_STRUCT_ADDRINFO@
HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@
HAVE_STRUCT_SIGACTION_SA_SIGACTION = @HAVE_STRUCT_SIGACTION_SA_SIGACTION@
HAVE_STRUCT_SOCKADDR_STORAGE = @HAVE_STRUCT_SOCKADDR_STORAGE@
@ -1273,6 +1281,7 @@ NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H = @NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H@
NEXT_AS_FIRST_DIRECTIVE_LIMITS_H = @NEXT_AS_FIRST_DIRECTIVE_LIMITS_H@
NEXT_AS_FIRST_DIRECTIVE_LOCALE_H = @NEXT_AS_FIRST_DIRECTIVE_LOCALE_H@
NEXT_AS_FIRST_DIRECTIVE_MATH_H = @NEXT_AS_FIRST_DIRECTIVE_MATH_H@
NEXT_AS_FIRST_DIRECTIVE_NETDB_H = @NEXT_AS_FIRST_DIRECTIVE_NETDB_H@
NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H = @NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H@
NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H = @NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H@
NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@
@ -1302,6 +1311,7 @@ NEXT_INTTYPES_H = @NEXT_INTTYPES_H@
NEXT_LIMITS_H = @NEXT_LIMITS_H@
NEXT_LOCALE_H = @NEXT_LOCALE_H@
NEXT_MATH_H = @NEXT_MATH_H@
NEXT_NETDB_H = @NEXT_NETDB_H@
NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@
NEXT_SIGNAL_H = @NEXT_SIGNAL_H@
NEXT_STDDEF_H = @NEXT_STDDEF_H@
@ -1412,6 +1422,8 @@ REPLACE_FTELL = @REPLACE_FTELL@
REPLACE_FTELLO = @REPLACE_FTELLO@
REPLACE_FTRUNCATE = @REPLACE_FTRUNCATE@
REPLACE_FUTIMENS = @REPLACE_FUTIMENS@
REPLACE_GAI_STRERROR = @REPLACE_GAI_STRERROR@
REPLACE_GETADDRINFO = @REPLACE_GETADDRINFO@
REPLACE_GETCWD = @REPLACE_GETCWD@
REPLACE_GETDELIM = @REPLACE_GETDELIM@
REPLACE_GETDOMAINNAME = @REPLACE_GETDOMAINNAME@

1
gnulib/aclocal.m4 vendored
View File

@ -1283,6 +1283,7 @@ m4_include([import/m4/mode_t.m4])
m4_include([import/m4/msvc-inval.m4])
m4_include([import/m4/msvc-nothrow.m4])
m4_include([import/m4/multiarch.m4])
m4_include([import/m4/netdb_h.m4])
m4_include([import/m4/netinet_in_h.m4])
m4_include([import/m4/nocrash.m4])
m4_include([import/m4/off_t.m4])

113
gnulib/configure vendored
View File

@ -782,6 +782,17 @@ NETINET_IN_H
HAVE_NETINET_IN_H
NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H
NEXT_NETINET_IN_H
HAVE_NETDB_H
NEXT_AS_FIRST_DIRECTIVE_NETDB_H
NEXT_NETDB_H
REPLACE_GETADDRINFO
REPLACE_GAI_STRERROR
HAVE_DECL_GETNAMEINFO
HAVE_DECL_GETADDRINFO
HAVE_DECL_GAI_STRERROR
HAVE_DECL_FREEADDRINFO
HAVE_STRUCT_ADDRINFO
GNULIB_GETADDRINFO
UNDEFINE_STRTOK_R
REPLACE_STRSIGNAL
REPLACE_STRERRORNAME_NP
@ -6782,6 +6793,7 @@ fi
# Code from module msvc-inval:
# Code from module msvc-nothrow:
# Code from module multiarch:
# Code from module netdb:
# Code from module netinet_in:
# Code from module nocrash:
# Code from module open:
@ -16380,6 +16392,16 @@ $as_echo "#define HAVE_MINMAX_IN_SYS_PARAM_H 1" >>confdefs.h
GNULIB_GETADDRINFO=0;
HAVE_STRUCT_ADDRINFO=1;
HAVE_DECL_FREEADDRINFO=1;
HAVE_DECL_GAI_STRERROR=1;
HAVE_DECL_GETADDRINFO=1;
HAVE_DECL_GETNAMEINFO=1;
REPLACE_GAI_STRERROR=0;
REPLACE_GETADDRINFO=0;
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for O_CLOEXEC" >&5
$as_echo_n "checking for O_CLOEXEC... " >&6; }
if ${gl_cv_macro_O_CLOEXEC+:} false; then :
@ -26252,6 +26274,97 @@ _ACEOF
if test $gl_cv_have_include_next = yes; then
gl_cv_next_netdb_h='<'netdb.h'>'
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <netdb.h>" >&5
$as_echo_n "checking absolute name of <netdb.h>... " >&6; }
if ${gl_cv_next_netdb_h+:} false; then :
$as_echo_n "(cached) " >&6
else
if test $ac_cv_header_netdb_h = yes; then
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <netdb.h>
_ACEOF
case "$host_os" in
aix*) gl_absname_cpp="$ac_cpp -C" ;;
*) gl_absname_cpp="$ac_cpp" ;;
esac
case "$host_os" in
mingw*)
gl_dirsep_regex='[/\\]'
;;
*)
gl_dirsep_regex='\/'
;;
esac
gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
gl_header_literal_regex=`echo 'netdb.h' \
| sed -e "$gl_make_literal_regex_sed"`
gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
s|^/[^/]|//&|
p
q
}'
gl_cv_absolute_netdb_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
sed -n "$gl_absolute_header_sed"`
gl_header=$gl_cv_absolute_netdb_h
gl_cv_next_netdb_h='"'$gl_header'"'
else
gl_cv_next_netdb_h='<'netdb.h'>'
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_netdb_h" >&5
$as_echo "$gl_cv_next_netdb_h" >&6; }
fi
NEXT_NETDB_H=$gl_cv_next_netdb_h
if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
# INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
gl_next_as_first_directive='<'netdb.h'>'
else
# INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
gl_next_as_first_directive=$gl_cv_next_netdb_h
fi
NEXT_AS_FIRST_DIRECTIVE_NETDB_H=$gl_next_as_first_directive
if test $ac_cv_header_netdb_h = yes; then
HAVE_NETDB_H=1
else
HAVE_NETDB_H=0
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <netinet/in.h> is self-contained" >&5
$as_echo_n "checking whether <netinet/in.h> is self-contained... " >&6; }
if ${gl_cv_header_netinet_in_h_selfcontained+:} false; then :

View File

@ -58,6 +58,7 @@
# mkdir \
# mkdtemp \
# mkostemp \
# netdb \
# pathmax \
# rawmemchr \
# readlink \
@ -1492,6 +1493,41 @@ EXTRA_libgnu_a_SOURCES += msvc-nothrow.c
## end gnulib module msvc-nothrow
## begin gnulib module netdb
BUILT_SOURCES += netdb.h
# We need the following in order to create <netdb.h> when the system
# doesn't have one that works with the given compiler.
netdb.h: netdb.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's|@''GUARD_PREFIX''@|GL|g' \
-e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
-e 's|@''NEXT_NETDB_H''@|$(NEXT_NETDB_H)|g' \
-e 's|@''HAVE_NETDB_H''@|$(HAVE_NETDB_H)|g' \
-e 's/@''GNULIB_GETADDRINFO''@/$(GNULIB_GETADDRINFO)/g' \
-e 's|@''HAVE_STRUCT_ADDRINFO''@|$(HAVE_STRUCT_ADDRINFO)|g' \
-e 's|@''HAVE_DECL_FREEADDRINFO''@|$(HAVE_DECL_FREEADDRINFO)|g' \
-e 's|@''HAVE_DECL_GAI_STRERROR''@|$(HAVE_DECL_GAI_STRERROR)|g' \
-e 's|@''HAVE_DECL_GETADDRINFO''@|$(HAVE_DECL_GETADDRINFO)|g' \
-e 's|@''HAVE_DECL_GETNAMEINFO''@|$(HAVE_DECL_GETNAMEINFO)|g' \
-e 's|@''REPLACE_GAI_STRERROR''@|$(REPLACE_GAI_STRERROR)|g' \
-e 's|@''REPLACE_GETADDRINFO''@|$(REPLACE_GETADDRINFO)|g' \
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
-e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
< $(srcdir)/netdb.in.h; \
} > $@-t && \
mv $@-t $@
MOSTLYCLEANFILES += netdb.h netdb.h-t
EXTRA_DIST += netdb.in.h
## end gnulib module netdb
## begin gnulib module netinet_in
BUILT_SOURCES += $(NETINET_IN_H)

View File

@ -72,6 +72,7 @@
# mkdir \
# mkdtemp \
# mkostemp \
# netdb \
# pathmax \
# rawmemchr \
# readlink \
@ -272,6 +273,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/depstand.m4 \
$(top_srcdir)/import/m4/msvc-inval.m4 \
$(top_srcdir)/import/m4/msvc-nothrow.m4 \
$(top_srcdir)/import/m4/multiarch.m4 \
$(top_srcdir)/import/m4/netdb_h.m4 \
$(top_srcdir)/import/m4/netinet_in_h.m4 \
$(top_srcdir)/import/m4/nocrash.m4 \
$(top_srcdir)/import/m4/off_t.m4 \
@ -595,6 +597,7 @@ GNULIB_FTELLO = @GNULIB_FTELLO@
GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@
GNULIB_FUTIMENS = @GNULIB_FUTIMENS@
GNULIB_FWRITE = @GNULIB_FWRITE@
GNULIB_GETADDRINFO = @GNULIB_GETADDRINFO@
GNULIB_GETC = @GNULIB_GETC@
GNULIB_GETCHAR = @GNULIB_GETCHAR@
GNULIB_GETCWD = @GNULIB_GETCWD@
@ -1000,16 +1003,20 @@ HAVE_DECL_FDOPENDIR = @HAVE_DECL_FDOPENDIR@
HAVE_DECL_FLOORF = @HAVE_DECL_FLOORF@
HAVE_DECL_FLOORL = @HAVE_DECL_FLOORL@
HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@
HAVE_DECL_FREEADDRINFO = @HAVE_DECL_FREEADDRINFO@
HAVE_DECL_FREXPL = @HAVE_DECL_FREXPL@
HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@
HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@
HAVE_DECL_GAI_STRERROR = @HAVE_DECL_GAI_STRERROR@
HAVE_DECL_GCVT = @HAVE_DECL_GCVT@
HAVE_DECL_GETADDRINFO = @HAVE_DECL_GETADDRINFO@
HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@
HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@
HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@
HAVE_DECL_GETLOGIN = @HAVE_DECL_GETLOGIN@
HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
HAVE_DECL_GETNAMEINFO = @HAVE_DECL_GETNAMEINFO@
HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@
HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@
HAVE_DECL_IMAXABS = @HAVE_DECL_IMAXABS@
@ -1167,6 +1174,7 @@ HAVE_MODFF = @HAVE_MODFF@
HAVE_MODFL = @HAVE_MODFL@
HAVE_MSVC_INVALID_PARAMETER_HANDLER = @HAVE_MSVC_INVALID_PARAMETER_HANDLER@
HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
HAVE_NETDB_H = @HAVE_NETDB_H@
HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@
HAVE_NEWLOCALE = @HAVE_NEWLOCALE@
HAVE_OPENAT = @HAVE_OPENAT@
@ -1240,6 +1248,7 @@ HAVE_STRTOD = @HAVE_STRTOD@
HAVE_STRTOLD = @HAVE_STRTOLD@
HAVE_STRTOLL = @HAVE_STRTOLL@
HAVE_STRTOULL = @HAVE_STRTOULL@
HAVE_STRUCT_ADDRINFO = @HAVE_STRUCT_ADDRINFO@
HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@
HAVE_STRUCT_SIGACTION_SA_SIGACTION = @HAVE_STRUCT_SIGACTION_SA_SIGACTION@
HAVE_STRUCT_SOCKADDR_STORAGE = @HAVE_STRUCT_SOCKADDR_STORAGE@
@ -1373,6 +1382,7 @@ NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H = @NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H@
NEXT_AS_FIRST_DIRECTIVE_LIMITS_H = @NEXT_AS_FIRST_DIRECTIVE_LIMITS_H@
NEXT_AS_FIRST_DIRECTIVE_LOCALE_H = @NEXT_AS_FIRST_DIRECTIVE_LOCALE_H@
NEXT_AS_FIRST_DIRECTIVE_MATH_H = @NEXT_AS_FIRST_DIRECTIVE_MATH_H@
NEXT_AS_FIRST_DIRECTIVE_NETDB_H = @NEXT_AS_FIRST_DIRECTIVE_NETDB_H@
NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H = @NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H@
NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H = @NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H@
NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@
@ -1402,6 +1412,7 @@ NEXT_INTTYPES_H = @NEXT_INTTYPES_H@
NEXT_LIMITS_H = @NEXT_LIMITS_H@
NEXT_LOCALE_H = @NEXT_LOCALE_H@
NEXT_MATH_H = @NEXT_MATH_H@
NEXT_NETDB_H = @NEXT_NETDB_H@
NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@
NEXT_SIGNAL_H = @NEXT_SIGNAL_H@
NEXT_STDDEF_H = @NEXT_STDDEF_H@
@ -1512,6 +1523,8 @@ REPLACE_FTELL = @REPLACE_FTELL@
REPLACE_FTELLO = @REPLACE_FTELLO@
REPLACE_FTRUNCATE = @REPLACE_FTRUNCATE@
REPLACE_FUTIMENS = @REPLACE_FUTIMENS@
REPLACE_GAI_STRERROR = @REPLACE_GAI_STRERROR@
REPLACE_GETADDRINFO = @REPLACE_GETADDRINFO@
REPLACE_GETCWD = @REPLACE_GETCWD@
REPLACE_GETDELIM = @REPLACE_GETDELIM@
REPLACE_GETDOMAINNAME = @REPLACE_GETDOMAINNAME@
@ -1813,11 +1826,11 @@ EXTRA_DIST = m4/gnulib-cache.m4 alloca.c alloca.in.h arpa_inet.in.h \
mbtowc-impl.h mbtowc.c memchr.c memchr.valgrind memmem.c \
memmem.c str-two-way.h mempcpy.c memrchr.c mkdir.c mkdtemp.c \
mkostemp.c msvc-inval.c msvc-inval.h msvc-nothrow.c \
msvc-nothrow.h netinet_in.in.h open.c openat.c openat.h \
dirent-private.h opendir.c pathmax.h pipe.c rawmemchr.c \
rawmemchr.valgrind dirent-private.h readdir.c readlink.c \
realloc.c rename.c dirent-private.h rewinddir.c rmdir.c \
same-inode.h save-cwd.h malloc/scratch_buffer.h \
msvc-nothrow.h netdb.in.h netinet_in.in.h open.c openat.c \
openat.h dirent-private.h opendir.c pathmax.h pipe.c \
rawmemchr.c rawmemchr.valgrind dirent-private.h readdir.c \
readlink.c realloc.c rename.c dirent-private.h rewinddir.c \
rmdir.c same-inode.h save-cwd.h malloc/scratch_buffer.h \
scratch_buffer.h setenv.c setlocale-lock.c setlocale_null.h \
windows-initguard.h signal.in.h _Noreturn.h arg-nonnull.h \
c++defs.h warn-on-use.h stat-w32.c stat-w32.h stat.c \
@ -1837,7 +1850,7 @@ EXTRA_DIST = m4/gnulib-cache.m4 alloca.c alloca.in.h arpa_inet.in.h \
wmemchr-impl.h wmemchr.c wmempcpy.c xalloc-oversized.h
BUILT_SOURCES = $(ALLOCA_H) arpa/inet.h ctype.h dirent.h $(ERRNO_H) \
fcntl.h $(FLOAT_H) $(FNMATCH_H) $(GLOB_H) inttypes.h \
$(LIMITS_H) locale.h math.h $(NETINET_IN_H) signal.h \
$(LIMITS_H) locale.h math.h netdb.h $(NETINET_IN_H) signal.h \
$(STDALIGN_H) $(STDBOOL_H) $(STDDEF_H) $(STDINT_H) stdio.h \
stdlib.h string.h strings.h sys/random.h sys/socket.h \
sys/stat.h sys/time.h sys/types.h sys/uio.h time.h unistd.h \
@ -1847,15 +1860,15 @@ MOSTLYCLEANFILES = core *.stackdump alloca.h alloca.h-t arpa/inet.h \
arpa/inet.h-t ctype.h ctype.h-t dirent.h dirent.h-t errno.h \
errno.h-t fcntl.h fcntl.h-t float.h float.h-t fnmatch.h \
fnmatch.h-t glob.h glob.h-t inttypes.h inttypes.h-t limits.h \
limits.h-t locale.h locale.h-t math.h math.h-t netinet/in.h \
netinet/in.h-t signal.h signal.h-t stdalign.h stdalign.h-t \
stdbool.h stdbool.h-t stddef.h stddef.h-t stdint.h stdint.h-t \
stdio.h stdio.h-t stdlib.h stdlib.h-t string.h string.h-t \
strings.h strings.h-t sys/random.h sys/random.h-t sys/socket.h \
sys/socket.h-t sys/stat.h sys/stat.h-t sys/time.h sys/time.h-t \
sys/types.h sys/types.h-t sys/uio.h sys/uio.h-t time.h \
time.h-t unistd.h unistd.h-t wchar.h wchar.h-t wctype.h \
wctype.h-t
limits.h-t locale.h locale.h-t math.h math.h-t netdb.h \
netdb.h-t netinet/in.h netinet/in.h-t signal.h signal.h-t \
stdalign.h stdalign.h-t stdbool.h stdbool.h-t stddef.h \
stddef.h-t stdint.h stdint.h-t stdio.h stdio.h-t stdlib.h \
stdlib.h-t string.h string.h-t strings.h strings.h-t \
sys/random.h sys/random.h-t sys/socket.h sys/socket.h-t \
sys/stat.h sys/stat.h-t sys/time.h sys/time.h-t sys/types.h \
sys/types.h-t sys/uio.h sys/uio.h-t time.h time.h-t unistd.h \
unistd.h-t wchar.h wchar.h-t wctype.h wctype.h-t
MOSTLYCLEANDIRS = arpa netinet sys sys sys sys
CLEANFILES =
DISTCLEANFILES =
@ -2972,6 +2985,32 @@ math.h: math.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(
} > $@-t && \
mv $@-t $@
# We need the following in order to create <netdb.h> when the system
# doesn't have one that works with the given compiler.
netdb.h: netdb.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's|@''GUARD_PREFIX''@|GL|g' \
-e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
-e 's|@''NEXT_NETDB_H''@|$(NEXT_NETDB_H)|g' \
-e 's|@''HAVE_NETDB_H''@|$(HAVE_NETDB_H)|g' \
-e 's/@''GNULIB_GETADDRINFO''@/$(GNULIB_GETADDRINFO)/g' \
-e 's|@''HAVE_STRUCT_ADDRINFO''@|$(HAVE_STRUCT_ADDRINFO)|g' \
-e 's|@''HAVE_DECL_FREEADDRINFO''@|$(HAVE_DECL_FREEADDRINFO)|g' \
-e 's|@''HAVE_DECL_GAI_STRERROR''@|$(HAVE_DECL_GAI_STRERROR)|g' \
-e 's|@''HAVE_DECL_GETADDRINFO''@|$(HAVE_DECL_GETADDRINFO)|g' \
-e 's|@''HAVE_DECL_GETNAMEINFO''@|$(HAVE_DECL_GETNAMEINFO)|g' \
-e 's|@''REPLACE_GAI_STRERROR''@|$(REPLACE_GAI_STRERROR)|g' \
-e 's|@''REPLACE_GETADDRINFO''@|$(REPLACE_GETADDRINFO)|g' \
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
-e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
< $(srcdir)/netdb.in.h; \
} > $@-t && \
mv $@-t $@
# We need the following in order to create <netinet/in.h> when the system
# doesn't have one.
@GL_GENERATE_NETINET_IN_H_TRUE@netinet/in.h: netinet_in.in.h $(top_builddir)/config.status

View File

@ -63,6 +63,7 @@
# mkdir \
# mkdtemp \
# mkostemp \
# netdb \
# pathmax \
# rawmemchr \
# readlink \
@ -109,6 +110,7 @@ gl_MODULES([
mkdir
mkdtemp
mkostemp
netdb
pathmax
rawmemchr
readlink

View File

@ -152,6 +152,7 @@ AC_DEFUN([gl_EARLY],
# Code from module msvc-inval:
# Code from module msvc-nothrow:
# Code from module multiarch:
# Code from module netdb:
# Code from module netinet_in:
# Code from module nocrash:
# Code from module open:
@ -598,6 +599,7 @@ AC_DEFUN([gl_INIT],
fi
gl_MODULE_INDICATOR([msvc-nothrow])
gl_MULTIARCH
gl_HEADER_NETDB
gl_HEADER_NETINET_IN
AC_PROG_MKDIR_P
gl_FUNC_OPEN
@ -1101,6 +1103,7 @@ AC_DEFUN([gl_FILE_LIST], [
lib/msvc-inval.h
lib/msvc-nothrow.c
lib/msvc-nothrow.h
lib/netdb.in.h
lib/netinet_in.in.h
lib/open.c
lib/openat-die.c
@ -1289,6 +1292,7 @@ AC_DEFUN([gl_FILE_LIST], [
m4/msvc-inval.m4
m4/msvc-nothrow.m4
m4/multiarch.m4
m4/netdb_h.m4
m4/netinet_in_h.m4
m4/nocrash.m4
m4/off_t.m4

View File

@ -0,0 +1,44 @@
# netdb_h.m4 serial 12
dnl Copyright (C) 2008-2021 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_HEADER_NETDB],
[
AC_REQUIRE([gl_NETDB_H_DEFAULTS])
gl_CHECK_NEXT_HEADERS([netdb.h])
if test $ac_cv_header_netdb_h = yes; then
HAVE_NETDB_H=1
else
HAVE_NETDB_H=0
fi
AC_SUBST([HAVE_NETDB_H])
dnl Check for declarations of anything we want to poison if the
dnl corresponding gnulib module is not in use.
gl_WARN_ON_USE_PREPARE([[#include <netdb.h>]],
[getaddrinfo freeaddrinfo gai_strerror getnameinfo])
])
AC_DEFUN([gl_NETDB_MODULE_INDICATOR],
[
dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
AC_REQUIRE([gl_NETDB_H_DEFAULTS])
gl_MODULE_INDICATOR_SET_VARIABLE([$1])
dnl Define it also as a C macro, for the benefit of the unit tests.
gl_MODULE_INDICATOR_FOR_TESTS([$1])
])
AC_DEFUN([gl_NETDB_H_DEFAULTS],
[
GNULIB_GETADDRINFO=0; AC_SUBST([GNULIB_GETADDRINFO])
dnl Assume proper GNU behavior unless another module says otherwise.
HAVE_STRUCT_ADDRINFO=1; AC_SUBST([HAVE_STRUCT_ADDRINFO])
HAVE_DECL_FREEADDRINFO=1; AC_SUBST([HAVE_DECL_FREEADDRINFO])
HAVE_DECL_GAI_STRERROR=1; AC_SUBST([HAVE_DECL_GAI_STRERROR])
HAVE_DECL_GETADDRINFO=1; AC_SUBST([HAVE_DECL_GETADDRINFO])
HAVE_DECL_GETNAMEINFO=1; AC_SUBST([HAVE_DECL_GETNAMEINFO])
REPLACE_GAI_STRERROR=0; AC_SUBST([REPLACE_GAI_STRERROR])
REPLACE_GETADDRINFO=0; AC_SUBST([REPLACE_GETADDRINFO])
])

295
gnulib/import/netdb.in.h Normal file
View File

@ -0,0 +1,295 @@
/* Provide a netdb.h header file for systems lacking it (read: MinGW).
Copyright (C) 2008-2021 Free Software Foundation, Inc.
Written by Simon Josefsson.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
This program 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, see <https://www.gnu.org/licenses/>. */
/* This file is supposed to be used on platforms that lack <netdb.h>.
It is intended to provide definitions and prototypes needed by an
application. */
#ifndef _@GUARD_PREFIX@_NETDB_H
#if __GNUC__ >= 3
@PRAGMA_SYSTEM_HEADER@
#endif
@PRAGMA_COLUMNS@
#if @HAVE_NETDB_H@
/* The include_next requires a split double-inclusion guard. */
# @INCLUDE_NEXT@ @NEXT_NETDB_H@
#endif
#ifndef _@GUARD_PREFIX@_NETDB_H
#define _@GUARD_PREFIX@_NETDB_H
/* Get <netdb.h> definitions such as 'socklen_t' on IRIX 6.5 and OSF/1 4.0 and
'struct hostent' on MinGW. */
#include <sys/socket.h>
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
/* The definition of _GL_ARG_NONNULL is copied here. */
/* The definition of _GL_WARN_ON_USE is copied here. */
/* Declarations for a platform that lacks <netdb.h>, or where it is
incomplete. */
#if @GNULIB_GETADDRINFO@
# if !@HAVE_STRUCT_ADDRINFO@
# ifdef __cplusplus
extern "C" {
# endif
# if !GNULIB_defined_struct_addrinfo
/* Structure to contain information about address of a service provider. */
struct addrinfo
{
int ai_flags; /* Input flags. */
int ai_family; /* Protocol family for socket. */
int ai_socktype; /* Socket type. */
int ai_protocol; /* Protocol for socket. */
socklen_t ai_addrlen; /* Length of socket address. */
struct sockaddr *ai_addr; /* Socket address for socket. */
char *ai_canonname; /* Canonical name for service location. */
struct addrinfo *ai_next; /* Pointer to next in list. */
};
# define GNULIB_defined_struct_addrinfo 1
# endif
# ifdef __cplusplus
}
# endif
# endif
/* Possible values for 'ai_flags' field in 'addrinfo' structure. */
# ifndef AI_PASSIVE
# define AI_PASSIVE 0x0001 /* Socket address is intended for 'bind'. */
# endif
# ifndef AI_CANONNAME
# define AI_CANONNAME 0x0002 /* Request for canonical name. */
# endif
# ifndef AI_NUMERICSERV
# define AI_NUMERICSERV 0x0400 /* Don't use name resolution. */
# endif
# if 0
# define AI_NUMERICHOST 0x0004 /* Don't use name resolution. */
# endif
/* These symbolic constants are required to be present by POSIX, but
our getaddrinfo replacement doesn't use them (yet). Setting them
to 0 on systems that doesn't have them avoids causing problems for
system getaddrinfo implementations that would be confused by
unknown values. */
# ifndef AI_V4MAPPED
# define AI_V4MAPPED 0 /* 0x0008: IPv4 mapped addresses are acceptable. */
# endif
# ifndef AI_ALL
# define AI_ALL 0 /* 0x0010: Return IPv4 mapped and IPv6 addresses. */
# endif
# ifndef AI_ADDRCONFIG
# define AI_ADDRCONFIG 0 /* 0x0020: Use configuration of this host to choose
returned address type. */
# endif
/* Error values for 'getaddrinfo' function. */
# ifndef EAI_BADFLAGS
# define EAI_BADFLAGS -1 /* Invalid value for 'ai_flags' field. */
# define EAI_NONAME -2 /* NAME or SERVICE is unknown. */
# define EAI_AGAIN -3 /* Temporary failure in name resolution. */
# define EAI_FAIL -4 /* Non-recoverable failure in name res. */
# define EAI_NODATA -5 /* No address associated with NAME. */
# define EAI_FAMILY -6 /* 'ai_family' not supported. */
# define EAI_SOCKTYPE -7 /* 'ai_socktype' not supported. */
# define EAI_SERVICE -8 /* SERVICE not supported for 'ai_socktype'. */
# define EAI_MEMORY -10 /* Memory allocation failure. */
# endif
/* Since EAI_NODATA is deprecated by RFC3493, some systems (at least
FreeBSD, which does define EAI_BADFLAGS) have removed the definition
in favor of EAI_NONAME. */
# if !defined EAI_NODATA && defined EAI_NONAME
# define EAI_NODATA EAI_NONAME
# endif
# ifndef EAI_OVERFLOW
/* Not defined on mingw32 and Haiku. */
# define EAI_OVERFLOW -12 /* Argument buffer overflow. */
# endif
# ifndef EAI_ADDRFAMILY
/* Not defined on mingw32. */
# define EAI_ADDRFAMILY -9 /* Address family for NAME not supported. */
# endif
# ifndef EAI_SYSTEM
/* Not defined on mingw32. */
# define EAI_SYSTEM -11 /* System error returned in 'errno'. */
# endif
# if 0
/* The commented out definitions below are not yet implemented in the
GNULIB getaddrinfo() replacement, so are not yet needed.
If they are restored, be sure to protect the definitions with #ifndef. */
# ifndef EAI_INPROGRESS
# define EAI_INPROGRESS -100 /* Processing request in progress. */
# define EAI_CANCELED -101 /* Request canceled. */
# define EAI_NOTCANCELED -102 /* Request not canceled. */
# define EAI_ALLDONE -103 /* All requests done. */
# define EAI_INTR -104 /* Interrupted by a signal. */
# define EAI_IDN_ENCODE -105 /* IDN encoding failed. */
# endif
# endif
/* Translate name of a service location and/or a service name to set of
socket addresses.
For more details, see the POSIX:2008 specification
<https://pubs.opengroup.org/onlinepubs/9699919799/functions/getaddrinfo.html>. */
# if @REPLACE_GETADDRINFO@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef getaddrinfo
# define getaddrinfo rpl_getaddrinfo
# endif
_GL_FUNCDECL_RPL (getaddrinfo, int,
(const char *restrict nodename,
const char *restrict servname,
const struct addrinfo *restrict hints,
struct addrinfo **restrict res)
_GL_ARG_NONNULL ((4)));
_GL_CXXALIAS_RPL (getaddrinfo, int,
(const char *restrict nodename,
const char *restrict servname,
const struct addrinfo *restrict hints,
struct addrinfo **restrict res));
# else
# if !@HAVE_DECL_GETADDRINFO@
_GL_FUNCDECL_SYS (getaddrinfo, int,
(const char *restrict nodename,
const char *restrict servname,
const struct addrinfo *restrict hints,
struct addrinfo **restrict res)
_GL_ARG_NONNULL ((4)));
# endif
_GL_CXXALIAS_SYS (getaddrinfo, int,
(const char *restrict nodename,
const char *restrict servname,
const struct addrinfo *restrict hints,
struct addrinfo **restrict res));
# endif
_GL_CXXALIASWARN (getaddrinfo);
/* Free 'addrinfo' structure AI including associated storage.
For more details, see the POSIX:2008 specification
<https://pubs.opengroup.org/onlinepubs/9699919799/functions/getaddrinfo.html>. */
# if @REPLACE_GETADDRINFO@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef freeaddrinfo
# define freeaddrinfo rpl_freeaddrinfo
# endif
_GL_FUNCDECL_RPL (freeaddrinfo, void, (struct addrinfo *ai)
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (freeaddrinfo, void, (struct addrinfo *ai));
# else
# if !@HAVE_DECL_FREEADDRINFO@
_GL_FUNCDECL_SYS (freeaddrinfo, void, (struct addrinfo *ai)
_GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (freeaddrinfo, void, (struct addrinfo *ai));
# endif
_GL_CXXALIASWARN (freeaddrinfo);
# if @REPLACE_GAI_STRERROR@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef gai_strerror
# define gai_strerror rpl_gai_strerror
# endif
_GL_FUNCDECL_RPL (gai_strerror, const char *, (int ecode));
_GL_CXXALIAS_RPL (gai_strerror, const char *, (int ecode));
# else
# if !@HAVE_DECL_GAI_STRERROR@
/* Convert error return from getaddrinfo() to a string.
For more details, see the POSIX:2008 specification
<https://pubs.opengroup.org/onlinepubs/9699919799/functions/gai_strerror.html>. */
_GL_FUNCDECL_SYS (gai_strerror, const char *, (int ecode));
# endif
_GL_CXXALIAS_SYS (gai_strerror, const char *, (int ecode));
# endif
# if __GLIBC__ >= 2
_GL_CXXALIASWARN (gai_strerror);
# endif
# if !@HAVE_DECL_GETNAMEINFO@
/* Convert socket address to printable node and service names.
For more details, see the POSIX:2008 specification
<https://pubs.opengroup.org/onlinepubs/9699919799/functions/getnameinfo.html>. */
_GL_FUNCDECL_SYS (getnameinfo, int,
(const struct sockaddr *restrict sa, socklen_t salen,
char *restrict node, socklen_t nodelen,
char *restrict service, socklen_t servicelen,
int flags)
_GL_ARG_NONNULL ((1)));
# endif
/* Need to cast, because on glibc systems, the seventh parameter is
unsigned int flags. */
_GL_CXXALIAS_SYS_CAST (getnameinfo, int,
(const struct sockaddr *restrict sa, socklen_t salen,
char *restrict node, socklen_t nodelen,
char *restrict service, socklen_t servicelen,
int flags));
_GL_CXXALIASWARN (getnameinfo);
/* Possible flags for getnameinfo. */
# ifndef NI_NUMERICHOST
# define NI_NUMERICHOST 1
# endif
# ifndef NI_NUMERICSERV
# define NI_NUMERICSERV 2
# endif
#elif defined GNULIB_POSIXCHECK
# undef getaddrinfo
# if HAVE_RAW_DECL_GETADDRINFO
_GL_WARN_ON_USE (getaddrinfo, "getaddrinfo is unportable - "
"use gnulib module getaddrinfo for portability");
# endif
# undef freeaddrinfo
# if HAVE_RAW_DECL_FREEADDRINFO
_GL_WARN_ON_USE (freeaddrinfo, "freeaddrinfo is unportable - "
"use gnulib module getaddrinfo for portability");
# endif
# undef gai_strerror
# if HAVE_RAW_DECL_GAI_STRERROR
_GL_WARN_ON_USE (gai_strerror, "gai_strerror is unportable - "
"use gnulib module getaddrinfo for portability");
# endif
# undef getnameinfo
# if HAVE_RAW_DECL_GETNAMEINFO
_GL_WARN_ON_USE (getnameinfo, "getnameinfo is unportable - "
"use gnulib module getaddrinfo for portability");
# endif
#endif
#endif /* _@GUARD_PREFIX@_NETDB_H */
#endif /* _@GUARD_PREFIX@_NETDB_H */

View File

@ -55,6 +55,7 @@ IMPORTED_GNULIB_MODULES="\
mkdir \
mkdtemp \
mkostemp \
netdb \
pathmax \
rawmemchr \
readlink \