diff options
author | Andy Wingo <wingo@pobox.com> | 2017-02-15 21:45:17 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2017-02-15 21:45:17 +0100 |
commit | 9399c1347918fb9b39ee4b1443bcc0df78ebf750 (patch) | |
tree | 9bf11de27dafef39ab79e4180e3161ad12775932 | |
parent | 7e641595cd9b45ce7339e21c20a8ab81af9278f6 (diff) |
Switch to accept4
* lib/Makefile.am:
* m4/gnulib-cache.m4:
* m4/gnulib-comp.m4: Switch from accept gnulib module to accept4.
* libguile/socket.c (scm_accept): Use accept4.
-rw-r--r-- | lib/Makefile.am | 12 | ||||
-rw-r--r-- | libguile/socket.c | 2 | ||||
-rw-r--r-- | m4/gnulib-cache.m4 | 4 | ||||
-rw-r--r-- | m4/gnulib-comp.m4 | 120 |
4 files changed, 23 insertions, 115 deletions
diff --git a/lib/Makefile.am b/lib/Makefile.am index 5da186f6f..6336db4cf 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -21,7 +21,7 @@ # the same distribution terms as the rest of that program. # # Generated by gnulib-tool. -# Reproduce by: gnulib-tool --import --local-dir=gnulib-local --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=lock --avoid=unistr/base --avoid=unistr/u8-mbtouc --avoid=unistr/u8-mbtouc-unsafe --avoid=unistr/u8-mbtoucr --avoid=unistr/u8-prev --avoid=unistr/u8-uctomb --avoid=unitypes --lgpl=3 --conditional-dependencies --libtool --macro-prefix=gl --no-vc-files accept alignof alloca-opt announce-gen autobuild bind byteswap c-strcase canonicalize-lgpl ceil clock-time close connect copysign dirfd dirname-lgpl duplocale environ extensions flock floor fpieee frexp fstat fsync full-read full-write func gendocs getaddrinfo getlogin getpeername getsockname getsockopt git-version-gen gitlog-to-changelog gnu-web-doc-update gnupload havelib iconv_open-utf inet_ntop inet_pton isfinite isinf isnan ldexp lib-symbol-versions lib-symbol-visibility libunistring link listen localcharset locale log1p lstat maintainer-makefile malloc-gnu malloca mkdir mkostemp nl_langinfo nproc open pipe-posix pipe2 poll putenv readlink recv recvfrom regex rename rmdir select send sendto setenv setsockopt shutdown socket stat-time stdlib strftime striconveh string sys_stat time times trunc unistd verify vsnprintf warnings wchar +# Reproduce by: gnulib-tool --import --local-dir=gnulib-local --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=lock --avoid=unistr/base --avoid=unistr/u8-mbtouc --avoid=unistr/u8-mbtouc-unsafe --avoid=unistr/u8-mbtoucr --avoid=unistr/u8-prev --avoid=unistr/u8-uctomb --avoid=unitypes --lgpl=3 --conditional-dependencies --libtool --macro-prefix=gl --no-vc-files accept4 alignof alloca-opt announce-gen autobuild bind byteswap c-strcase canonicalize-lgpl ceil clock-time close connect copysign dirfd dirname-lgpl duplocale environ extensions flock floor fpieee frexp fstat fsync full-read full-write func gendocs getaddrinfo getlogin getpeername getsockname getsockopt git-version-gen gitlog-to-changelog gnu-web-doc-update gnupload havelib iconv_open-utf inet_ntop inet_pton isfinite isinf isnan ldexp lib-symbol-versions lib-symbol-visibility libunistring link listen localcharset locale log1p lstat maintainer-makefile malloc-gnu malloca mkdir mkostemp nl_langinfo nproc open pipe-posix pipe2 poll putenv readlink recv recvfrom regex rename rmdir select send sendto setenv setsockopt shutdown socket stat-time stdlib strftime striconveh string sys_stat time times trunc unistd verify vsnprintf warnings wchar AUTOMAKE_OPTIONS = 1.9.6 gnits @@ -93,6 +93,12 @@ EXTRA_libgnu_la_SOURCES += accept.c ## end gnulib module accept +## begin gnulib module accept4 + +libgnu_la_SOURCES += accept4.c + +## end gnulib module accept4 + ## begin gnulib module alignof @@ -1579,9 +1585,7 @@ EXTRA_libgnu_la_SOURCES += mktime.c ## begin gnulib module msvc-inval -if gl_GNULIB_ENABLED_f691f076f650964c9f5598c3ee487616 -endif EXTRA_DIST += msvc-inval.c msvc-inval.h EXTRA_libgnu_la_SOURCES += msvc-inval.c @@ -1590,9 +1594,7 @@ EXTRA_libgnu_la_SOURCES += msvc-inval.c ## begin gnulib module msvc-nothrow -if gl_GNULIB_ENABLED_676220fa4366efa9bdbfccf11a857c07 -endif EXTRA_DIST += msvc-nothrow.c msvc-nothrow.h EXTRA_libgnu_la_SOURCES += msvc-nothrow.c diff --git a/libguile/socket.c b/libguile/socket.c index 4f2acffd7..9ddc4a21f 100644 --- a/libguile/socket.c +++ b/libguile/socket.c @@ -1268,7 +1268,7 @@ SCM_DEFINE (scm_accept, "accept", 1, 0, 0, sock = SCM_COERCE_OUTPORT (sock); SCM_VALIDATE_OPFPORT (1, sock); fd = SCM_FPORT_FDES (sock); - SCM_SYSCALL (newfd = accept (fd, (struct sockaddr *) &addr, &addr_size)); + SCM_SYSCALL (newfd = accept4 (fd, (struct sockaddr *) &addr, &addr_size, 0)); if (newfd == -1) { if (errno == EAGAIN || errno == EWOULDBLOCK) diff --git a/m4/gnulib-cache.m4 b/m4/gnulib-cache.m4 index f552a18c1..01f82d59b 100644 --- a/m4/gnulib-cache.m4 +++ b/m4/gnulib-cache.m4 @@ -27,12 +27,12 @@ # Specification in the form of a command-line invocation: -# gnulib-tool --import --local-dir=gnulib-local --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=lock --avoid=unistr/base --avoid=unistr/u8-mbtouc --avoid=unistr/u8-mbtouc-unsafe --avoid=unistr/u8-mbtoucr --avoid=unistr/u8-prev --avoid=unistr/u8-uctomb --avoid=unitypes --lgpl=3 --conditional-dependencies --libtool --macro-prefix=gl --no-vc-files accept alignof alloca-opt announce-gen autobuild bind byteswap c-strcase canonicalize-lgpl ceil clock-time close connect copysign dirfd dirname-lgpl duplocale environ extensions flock floor fpieee frexp fstat fsync full-read full-write func gendocs getaddrinfo getlogin getpeername getsockname getsockopt git-version-gen gitlog-to-changelog gnu-web-doc-update gnupload havelib iconv_open-utf inet_ntop inet_pton isfinite isinf isnan ldexp lib-symbol-versions lib-symbol-visibility libunistring link listen localcharset locale log1p lstat maintainer-makefile malloc-gnu malloca mkdir mkostemp nl_langinfo nproc open pipe-posix pipe2 poll putenv readlink recv recvfrom regex rename rmdir select send sendto setenv setsockopt shutdown socket stat-time stdlib strftime striconveh string sys_stat time times trunc unistd verify vsnprintf warnings wchar +# gnulib-tool --import --local-dir=gnulib-local --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=lock --avoid=unistr/base --avoid=unistr/u8-mbtouc --avoid=unistr/u8-mbtouc-unsafe --avoid=unistr/u8-mbtoucr --avoid=unistr/u8-prev --avoid=unistr/u8-uctomb --avoid=unitypes --lgpl=3 --conditional-dependencies --libtool --macro-prefix=gl --no-vc-files accept4 alignof alloca-opt announce-gen autobuild bind byteswap c-strcase canonicalize-lgpl ceil clock-time close connect copysign dirfd dirname-lgpl duplocale environ extensions flock floor fpieee frexp fstat fsync full-read full-write func gendocs getaddrinfo getlogin getpeername getsockname getsockopt git-version-gen gitlog-to-changelog gnu-web-doc-update gnupload havelib iconv_open-utf inet_ntop inet_pton isfinite isinf isnan ldexp lib-symbol-versions lib-symbol-visibility libunistring link listen localcharset locale log1p lstat maintainer-makefile malloc-gnu malloca mkdir mkostemp nl_langinfo nproc open pipe-posix pipe2 poll putenv readlink recv recvfrom regex rename rmdir select send sendto setenv setsockopt shutdown socket stat-time stdlib strftime striconveh string sys_stat time times trunc unistd verify vsnprintf warnings wchar # Specification in the form of a few gnulib-tool.m4 macro invocations: gl_LOCAL_DIR([gnulib-local]) gl_MODULES([ - accept + accept4 alignof alloca-opt announce-gen diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4 index 9380120e7..290d77933 100644 --- a/m4/gnulib-comp.m4 +++ b/m4/gnulib-comp.m4 @@ -44,6 +44,7 @@ AC_DEFUN([gl_EARLY], # Code from module absolute-header: # Code from module accept: + # Code from module accept4: # Code from module alignof: # Code from module alloca: # Code from module alloca-opt: @@ -267,6 +268,8 @@ AC_DEFUN([gl_INIT], AC_LIBOBJ([accept]) fi gl_SYS_SOCKET_MODULE_INDICATOR([accept]) + gl_FUNC_ACCEPT4 + gl_SYS_SOCKET_MODULE_INDICATOR([accept4]) gl_FUNC_ALLOCA gl_HEADER_ARPA_INET AC_PROG_MKDIR_P @@ -529,6 +532,14 @@ AC_DEFUN([gl_INIT], fi gl_MODULE_INDICATOR([mkostemp]) gl_STDLIB_MODULE_INDICATOR([mkostemp]) + AC_REQUIRE([gl_MSVC_INVAL]) + if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then + AC_LIBOBJ([msvc-inval]) + fi + AC_REQUIRE([gl_MSVC_NOTHROW]) + if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then + AC_LIBOBJ([msvc-nothrow]) + fi gl_MULTIARCH gl_HEADER_NETDB gl_HEADER_NETINET_IN @@ -731,8 +742,6 @@ AC_DEFUN([gl_INIT], gl_gnulib_enabled_memchr=false gl_gnulib_enabled_mktime=false gl_gnulib_enabled_5264294aa0a5557541b53c8c741f7f31=false - gl_gnulib_enabled_f691f076f650964c9f5598c3ee487616=false - gl_gnulib_enabled_676220fa4366efa9bdbfccf11a857c07=false gl_gnulib_enabled_pathmax=false gl_gnulib_enabled_raise=false gl_gnulib_enabled_round=false @@ -809,12 +818,6 @@ AC_SUBST([LTALLOCA]) fi gl_UNISTD_MODULE_INDICATOR([dup2]) gl_gnulib_enabled_dup2=true - if test $HAVE_DUP2 = 0 || test $REPLACE_DUP2 = 1; then - func_gl_gnulib_m4code_f691f076f650964c9f5598c3ee487616 - fi - if test $HAVE_DUP2 = 0 || test $REPLACE_DUP2 = 1; then - func_gl_gnulib_m4code_676220fa4366efa9bdbfccf11a857c07 - fi fi } func_gl_gnulib_m4code_43fe87a341d9b4b93c47c3ad819a5239 () @@ -1007,27 +1010,6 @@ AC_SUBST([LTALLOCA]) func_gl_gnulib_m4code_mktime fi } - func_gl_gnulib_m4code_f691f076f650964c9f5598c3ee487616 () - { - if ! $gl_gnulib_enabled_f691f076f650964c9f5598c3ee487616; then - AC_REQUIRE([gl_MSVC_INVAL]) - if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then - AC_LIBOBJ([msvc-inval]) - fi - gl_gnulib_enabled_f691f076f650964c9f5598c3ee487616=true - fi - } - func_gl_gnulib_m4code_676220fa4366efa9bdbfccf11a857c07 () - { - if ! $gl_gnulib_enabled_676220fa4366efa9bdbfccf11a857c07; then - AC_REQUIRE([gl_MSVC_NOTHROW]) - if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then - AC_LIBOBJ([msvc-nothrow]) - fi - gl_gnulib_enabled_676220fa4366efa9bdbfccf11a857c07=true - func_gl_gnulib_m4code_f691f076f650964c9f5598c3ee487616 - fi - } func_gl_gnulib_m4code_pathmax () { if ! $gl_gnulib_enabled_pathmax; then @@ -1045,9 +1027,6 @@ AC_SUBST([LTALLOCA]) fi gl_SIGNAL_MODULE_INDICATOR([raise]) gl_gnulib_enabled_raise=true - if test $HAVE_RAISE = 0 || test $REPLACE_RAISE = 1; then - func_gl_gnulib_m4code_f691f076f650964c9f5598c3ee487616 - fi fi } func_gl_gnulib_m4code_round () @@ -1133,7 +1112,6 @@ AC_SUBST([LTALLOCA]) AC_REQUIRE([gl_SOCKETS]) gl_gnulib_enabled_sockets=true func_gl_gnulib_m4code_43fe87a341d9b4b93c47c3ad819a5239 - func_gl_gnulib_m4code_676220fa4366efa9bdbfccf11a857c07 fi } func_gl_gnulib_m4code_stat () @@ -1258,39 +1236,18 @@ AC_SUBST([LTALLOCA]) func_gl_gnulib_m4code_size_max fi } - if test "$ac_cv_header_winsock2_h" = yes; then - func_gl_gnulib_m4code_676220fa4366efa9bdbfccf11a857c07 - fi - if test "$ac_cv_header_winsock2_h" = yes; then - func_gl_gnulib_m4code_676220fa4366efa9bdbfccf11a857c07 - fi if test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1; then func_gl_gnulib_m4code_pathmax fi if test $REPLACE_CLOSE = 1; then func_gl_gnulib_m4code_43fe87a341d9b4b93c47c3ad819a5239 fi - if test $REPLACE_CLOSE = 1; then - func_gl_gnulib_m4code_f691f076f650964c9f5598c3ee487616 - fi - if test "$ac_cv_header_winsock2_h" = yes; then - func_gl_gnulib_m4code_676220fa4366efa9bdbfccf11a857c07 - fi if test $HAVE_COPYSIGN = 0; then func_gl_gnulib_m4code_signbit fi - if test $HAVE_FLOCK = 0; then - func_gl_gnulib_m4code_676220fa4366efa9bdbfccf11a857c07 - fi if test $gl_func_frexp != yes; then func_gl_gnulib_m4code_b1df7117b479d2da59d76deba468ee21 fi - if test $REPLACE_STAT = 1; then - func_gl_gnulib_m4code_f691f076f650964c9f5598c3ee487616 - fi - if test $HAVE_FSYNC = 0; then - func_gl_gnulib_m4code_676220fa4366efa9bdbfccf11a857c07 - fi if test $HAVE_GETADDRINFO = 0 || test $HAVE_DECL_GAI_STRERROR = 0 || test $REPLACE_GAI_STRERROR = 1; then func_gl_gnulib_m4code_be453cec5eecf5731a274f2de7f2db36 fi @@ -1306,15 +1263,6 @@ AC_SUBST([LTALLOCA]) if test $HAVE_GETADDRINFO = 0; then func_gl_gnulib_m4code_sockets fi - if test "$ac_cv_header_winsock2_h" = yes; then - func_gl_gnulib_m4code_676220fa4366efa9bdbfccf11a857c07 - fi - if test "$ac_cv_header_winsock2_h" = yes; then - func_gl_gnulib_m4code_676220fa4366efa9bdbfccf11a857c07 - fi - if test "$ac_cv_header_winsock2_h" = yes; then - func_gl_gnulib_m4code_676220fa4366efa9bdbfccf11a857c07 - fi if test $REPLACE_ISFINITE = 1; then func_gl_gnulib_m4code_b1df7117b479d2da59d76deba468ee21 fi @@ -1330,9 +1278,6 @@ AC_SUBST([LTALLOCA]) if test $HAVE_LINK = 0 || test $REPLACE_LINK = 1; then func_gl_gnulib_m4code_f9850631dca91859e9cddac9359921c0 fi - if test "$ac_cv_header_winsock2_h" = yes; then - func_gl_gnulib_m4code_676220fa4366efa9bdbfccf11a857c07 - fi if test $HAVE_LOG1P = 0 || test $REPLACE_LOG1P = 1; then func_gl_gnulib_m4code_log fi @@ -1358,26 +1303,11 @@ AC_SUBST([LTALLOCA]) func_gl_gnulib_m4code_assure fi if test $HAVE_POLL = 0 || test $REPLACE_POLL = 1; then - func_gl_gnulib_m4code_676220fa4366efa9bdbfccf11a857c07 - fi - if test $HAVE_POLL = 0 || test $REPLACE_POLL = 1; then func_gl_gnulib_m4code_sockets fi - if test $REPLACE_READ = 1; then - func_gl_gnulib_m4code_f691f076f650964c9f5598c3ee487616 - fi - if test $REPLACE_READ = 1; then - func_gl_gnulib_m4code_676220fa4366efa9bdbfccf11a857c07 - fi if test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1; then func_gl_gnulib_m4code_stat fi - if test "$ac_cv_header_winsock2_h" = yes; then - func_gl_gnulib_m4code_676220fa4366efa9bdbfccf11a857c07 - fi - if test "$ac_cv_header_winsock2_h" = yes; then - func_gl_gnulib_m4code_676220fa4366efa9bdbfccf11a857c07 - fi if test $ac_use_included_regex = yes; then func_gl_gnulib_m4code_btowc fi @@ -1415,27 +1345,9 @@ AC_SUBST([LTALLOCA]) func_gl_gnulib_m4code_dup2 fi if test $REPLACE_SELECT = 1; then - func_gl_gnulib_m4code_676220fa4366efa9bdbfccf11a857c07 - fi - if test $REPLACE_SELECT = 1; then func_gl_gnulib_m4code_sockets fi if test "$ac_cv_header_winsock2_h" = yes; then - func_gl_gnulib_m4code_676220fa4366efa9bdbfccf11a857c07 - fi - if test "$ac_cv_header_winsock2_h" = yes; then - func_gl_gnulib_m4code_676220fa4366efa9bdbfccf11a857c07 - fi - if test "$ac_cv_header_winsock2_h" = yes; then - func_gl_gnulib_m4code_676220fa4366efa9bdbfccf11a857c07 - fi - if test "$ac_cv_header_winsock2_h" = yes; then - func_gl_gnulib_m4code_676220fa4366efa9bdbfccf11a857c07 - fi - if test "$ac_cv_header_winsock2_h" = yes; then - func_gl_gnulib_m4code_676220fa4366efa9bdbfccf11a857c07 - fi - if test "$ac_cv_header_winsock2_h" = yes; then func_gl_gnulib_m4code_sockets fi if test "$HAVE_TIMEZONE_T" = 0; then @@ -1454,12 +1366,6 @@ AC_SUBST([LTALLOCA]) func_gl_gnulib_m4code_vasnprintf fi if test $REPLACE_WRITE = 1; then - func_gl_gnulib_m4code_f691f076f650964c9f5598c3ee487616 - fi - if test $REPLACE_WRITE = 1; then - func_gl_gnulib_m4code_676220fa4366efa9bdbfccf11a857c07 - fi - if test $REPLACE_WRITE = 1; then func_gl_gnulib_m4code_raise fi m4_pattern_allow([^gl_GNULIB_ENABLED_]) @@ -1486,8 +1392,6 @@ AC_SUBST([LTALLOCA]) AM_CONDITIONAL([gl_GNULIB_ENABLED_memchr], [$gl_gnulib_enabled_memchr]) AM_CONDITIONAL([gl_GNULIB_ENABLED_mktime], [$gl_gnulib_enabled_mktime]) AM_CONDITIONAL([gl_GNULIB_ENABLED_5264294aa0a5557541b53c8c741f7f31], [$gl_gnulib_enabled_5264294aa0a5557541b53c8c741f7f31]) - AM_CONDITIONAL([gl_GNULIB_ENABLED_f691f076f650964c9f5598c3ee487616], [$gl_gnulib_enabled_f691f076f650964c9f5598c3ee487616]) - AM_CONDITIONAL([gl_GNULIB_ENABLED_676220fa4366efa9bdbfccf11a857c07], [$gl_gnulib_enabled_676220fa4366efa9bdbfccf11a857c07]) AM_CONDITIONAL([gl_GNULIB_ENABLED_pathmax], [$gl_gnulib_enabled_pathmax]) AM_CONDITIONAL([gl_GNULIB_ENABLED_raise], [$gl_gnulib_enabled_raise]) AM_CONDITIONAL([gl_GNULIB_ENABLED_round], [$gl_gnulib_enabled_round]) @@ -1662,6 +1566,7 @@ AC_DEFUN([gl_FILE_LIST], [ doc/gendocs_template doc/gendocs_template_min lib/accept.c + lib/accept4.c lib/alignof.h lib/alloca.c lib/alloca.in.h @@ -1881,6 +1786,7 @@ AC_DEFUN([gl_FILE_LIST], [ lib/xsize.h m4/00gnulib.m4 m4/absolute-header.m4 + m4/accept4.m4 m4/alloca.m4 m4/arpa_inet_h.m4 m4/autobuild.m4 |