]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-41462: Add os.set_blocking() support for VxWorks RTOS (GH-21713)
authorpxinwr <peixing.xin@windriver.com>
Mon, 7 Dec 2020 20:41:12 +0000 (04:41 +0800)
committerGitHub <noreply@github.com>
Mon, 7 Dec 2020 20:41:12 +0000 (21:41 +0100)
Misc/NEWS.d/next/Library/2020-08-03-17-54-32.bpo-41462.ek38d_.rst [new file with mode: 0644]
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 (file)
index 0000000..ca5da1b
--- /dev/null
@@ -0,0 +1 @@
+Add :func:`os.set_blocking()` support for VxWorks RTOS.
index b589d7390d46dcd3391ac006c59d7c4790862ec7..ac382821174211ddf4ce8c91c9626c9378cb57ef 100644 (file)
@@ -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;