[Python-checkins] bpo-41462: Add os.set_blocking() support for VxWorks RTOS (GH-21713)

vstinner webhook-mailer at python.org
Mon Dec 7 15:41:41 EST 2020


https://github.com/python/cpython/commit/06afac6c5740bb81d2b7ab9639d2b08cccf77d33
commit: 06afac6c5740bb81d2b7ab9639d2b08cccf77d33
branch: master
author: pxinwr <peixing.xin at windriver.com>
committer: vstinner <vstinner at python.org>
date: 2020-12-07T21:41:12+01:00
summary:

bpo-41462: Add os.set_blocking() support for VxWorks RTOS (GH-21713)

files:
A Misc/NEWS.d/next/Library/2020-08-03-17-54-32.bpo-41462.ek38d_.rst
M Python/fileutils.c

diff --git a/Misc/NEWS.d/next/Library/2020-08-03-17-54-32.bpo-41462.ek38d_.rst b/Misc/NEWS.d/next/Library/2020-08-03-17-54-32.bpo-41462.ek38d_.rst
new file mode 100644
index 0000000000000..ca5da1b17b436
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2020-08-03-17-54-32.bpo-41462.ek38d_.rst
@@ -0,0 +1 @@
+Add :func:`os.set_blocking()` support for VxWorks RTOS.
diff --git a/Python/fileutils.c b/Python/fileutils.c
index b589d7390d46d..ac38282117421 100644
--- a/Python/fileutils.c
+++ b/Python/fileutils.c
@@ -2070,7 +2070,9 @@ _Py_get_blocking(int fd)
 int
 _Py_set_blocking(int fd, int blocking)
 {
-#if defined(HAVE_SYS_IOCTL_H) && defined(FIONBIO)
+/* bpo-41462: On VxWorks, ioctl(FIONBIO) only works on sockets.
+   Use fcntl() instead. */
+#if defined(HAVE_SYS_IOCTL_H) && defined(FIONBIO) && !defined(__VXWORKS__)
     int arg = !blocking;
     if (ioctl(fd, FIONBIO, &arg) < 0)
         goto error;



More information about the Python-checkins mailing list