summaryrefslogtreecommitdiffstats
path: root/Modules/socketmodule.c
diff options
context:
space:
mode:
authorChristian Heimes <christian@python.org>2021-11-26 14:16:54 (GMT)
committerGitHub <noreply@github.com>2021-11-26 14:16:54 (GMT)
commit8caceb7a474bf32cddfd25fba25b531ff65f4365 (patch)
tree910efc6bfc66a2d9b665c73eb88c0e88cfc5650c /Modules/socketmodule.c
parentdb671b010cb4662011c6e6567a1f4fcd509102b8 (diff)
downloadcpython-8caceb7a474bf32cddfd25fba25b531ff65f4365.zip
cpython-8caceb7a474bf32cddfd25fba25b531ff65f4365.tar.gz
cpython-8caceb7a474bf32cddfd25fba25b531ff65f4365.tar.bz2
bpo-40280: Add configure check for socket shutdown (GH-29795)
Diffstat (limited to 'Modules/socketmodule.c')
-rw-r--r--Modules/socketmodule.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
index ed1043c..89e93c5 100644
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -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},