]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-40280: Add configure check for socket shutdown (GH-29795)
authorChristian Heimes <christian@python.org>
Fri, 26 Nov 2021 14:16:54 +0000 (16:16 +0200)
committerGitHub <noreply@github.com>
Fri, 26 Nov 2021 14:16:54 +0000 (15:16 +0100)
Misc/NEWS.d/next/Build/2021-11-26-14-09-04.bpo-40280.ZLpwQf.rst [new file with mode: 0644]
Modules/socketmodule.c
PC/pyconfig.h
configure
configure.ac
pyconfig.h.in

diff --git a/Misc/NEWS.d/next/Build/2021-11-26-14-09-04.bpo-40280.ZLpwQf.rst b/Misc/NEWS.d/next/Build/2021-11-26-14-09-04.bpo-40280.ZLpwQf.rst
new file mode 100644 (file)
index 0000000..ce75feb
--- /dev/null
@@ -0,0 +1,3 @@
+``configure`` now checks for socket ``shutdown`` function. The check makes
+it possible to disable ``SYS_shutdown`` with ``ac_cv_func_shutdown=no`` in
+CONFIG_SITE.
index ed1043c0c43a507f2d3aa2f80f51ca7a60344197..89e93c58187c960db6e8e7993c14231d99135f2f 100644 (file)
@@ -4788,6 +4788,7 @@ Set operation mode, IV and length of associated data for an AF_ALG\n\
 operation socket.");
 #endif
 
+#ifdef HAVE_SHUTDOWN
 /* s.shutdown(how) method */
 
 static PyObject *
@@ -4812,6 +4813,7 @@ PyDoc_STRVAR(shutdown_doc,
 \n\
 Shut down the reading side of the socket (flag == SHUT_RD), the writing side\n\
 of the socket (flag == SHUT_WR), or both ends (flag == SHUT_RDWR).");
+#endif
 
 #if defined(MS_WINDOWS) && defined(SIO_RCVALL)
 static PyObject*
@@ -4957,8 +4959,10 @@ static PyMethodDef sock_methods[] = {
                       gettimeout_doc},
     {"setsockopt",        (PyCFunction)sock_setsockopt, METH_VARARGS,
                       setsockopt_doc},
+#ifdef HAVE_SHUTDOWN
     {"shutdown",          (PyCFunction)sock_shutdown, METH_O,
                       shutdown_doc},
+#endif
 #ifdef CMSG_LEN
     {"recvmsg",           (PyCFunction)sock_recvmsg, METH_VARARGS,
                       recvmsg_doc},
index b3e73d4dabefed32337c42f48979cef23adf7c80..5d8d9f3618454ea0ed60422b13fa844d63b98a11 100644 (file)
@@ -517,6 +517,9 @@ Py_NO_ENABLE_SHARED to find out.  Also support MS_NO_COREDLL for b/w compat */
 /* Define if you have siginterrupt.  */
 /* #undef HAVE_SIGINTERRUPT */
 
+/* Define to 1 if you have the `shutdown' function. */
+#define HAVE_SHUTDOWN 1
+
 /* Define if you have symlink.  */
 /* #undef HAVE_SYMLINK */
 
index 1aaa13abd68161d49dd9cde426200c61dc26382f..5f8b11c9415f7a5f50c505e212dd4ecdc9eb0a34 100755 (executable)
--- a/configure
+++ b/configure
@@ -13395,7 +13395,7 @@ for ac_func in alarm accept4 setitimer getitimer bind_textdomain_codeset chown \
  setgid sethostname \
  setlocale setregid setreuid setresuid setresgid setsid setpgid setpgrp setpriority setuid setvbuf \
  sched_get_priority_max sched_setaffinity sched_setscheduler sched_setparam \
- sched_rr_get_interval \
+ sched_rr_get_interval shutdown \
  sigaction sigaltstack sigfillset siginterrupt sigpending sigrelse \
  sigtimedwait sigwait sigwaitinfo snprintf splice strftime strlcpy strsignal symlinkat sync \
  sysconf tcgetpgrp tcsetpgrp tempnam timegm times tmpfile tmpnam tmpnam_r \
index 7963f9ccaf80a5e69b616f4573fcf53c48367ae8..447a9c85099c46518b08238048dabe88f236bdb8 100644 (file)
@@ -3956,7 +3956,7 @@ AC_CHECK_FUNCS(alarm accept4 setitimer getitimer bind_textdomain_codeset chown \
  setgid sethostname \
  setlocale setregid setreuid setresuid setresgid setsid setpgid setpgrp setpriority setuid setvbuf \
  sched_get_priority_max sched_setaffinity sched_setscheduler sched_setparam \
- sched_rr_get_interval \
+ sched_rr_get_interval shutdown \
  sigaction sigaltstack sigfillset siginterrupt sigpending sigrelse \
  sigtimedwait sigwait sigwaitinfo snprintf splice strftime strlcpy strsignal symlinkat sync \
  sysconf tcgetpgrp tcsetpgrp tempnam timegm times tmpfile tmpnam tmpnam_r \
index 842759fb213ae1fb80209765cf9910907e8ee19a..b837b9ad2e2db6b79348b2dadf5c0ee6f896c177 100644 (file)
 /* Define to 1 if you have the `shm_unlink' function. */
 #undef HAVE_SHM_UNLINK
 
+/* Define to 1 if you have the `shutdown' function. */
+#undef HAVE_SHUTDOWN
+
 /* Define to 1 if you have the `sigaction' function. */
 #undef HAVE_SIGACTION