From 5a4082e5e1790809495971bba47b763143770aed Mon Sep 17 00:00:00 2001 From: pxin Date: Fri, 31 Jul 2020 17:37:16 +0800 Subject: [PATCH 1/3] Fix _Py_set_blocking() for VxWorks RTOS --- Python/fileutils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Python/fileutils.c b/Python/fileutils.c index 50ef3c174acc84..fc5473d043f92c 100644 --- a/Python/fileutils.c +++ b/Python/fileutils.c @@ -2007,7 +2007,7 @@ _Py_get_blocking(int fd) int _Py_set_blocking(int fd, int blocking) { -#if defined(HAVE_SYS_IOCTL_H) && defined(FIONBIO) +#if defined(HAVE_SYS_IOCTL_H) && defined(FIONBIO) && !defined(__VXWORKS__) int arg = !blocking; if (ioctl(fd, FIONBIO, &arg) < 0) goto error; From 521dbb84a34e783c6b32e3377264e6ad1eacddf8 Mon Sep 17 00:00:00 2001 From: pxin Date: Mon, 3 Aug 2020 17:57:26 +0800 Subject: [PATCH 2/3] add NEWS --- .../NEWS.d/next/Library/2020-08-03-17-54-32.bpo-41462.ek38d_.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Library/2020-08-03-17-54-32.bpo-41462.ek38d_.rst 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 00000000000000..ca5da1b17b4363 --- /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. From 157170a34d2822a445af4e6005885ff307cdb5be Mon Sep 17 00:00:00 2001 From: pxin Date: Mon, 7 Dec 2020 19:00:25 +0800 Subject: [PATCH 3/3] add comments for VxWorks fix --- Python/fileutils.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Python/fileutils.c b/Python/fileutils.c index fc5473d043f92c..9cf24ab8fc14c9 100644 --- a/Python/fileutils.c +++ b/Python/fileutils.c @@ -2007,6 +2007,8 @@ _Py_get_blocking(int fd) int _Py_set_blocking(int fd, int blocking) { +/* 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)