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

This commit is contained in:
pxinwr 2020-12-08 04:41:12 +08:00 committed by GitHub
parent b63a620014
commit 06afac6c57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -0,0 +1 @@
Add :func:`os.set_blocking()` support for VxWorks RTOS.

View 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;