diff options
author | Alexis Christoforides <alexis@thenull.net> | 2018-06-02 13:02:30 +0300 |
---|---|---|
committer | Marek Safar <marek.safar@gmail.com> | 2018-06-20 17:44:11 +0300 |
commit | 17804432d376b3ef6bf6db4edaa68a910b18e1b1 (patch) | |
tree | 236eb67739d00d57828b2903a5603d1c849ee9a2 | |
parent | ed31064357cf8decf4316181810461bb11561dc1 (diff) |
Use icall for blocking read call in Mono
-rw-r--r-- | src/Native/Unix/System.Native/pal_io.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/Native/Unix/System.Native/pal_io.c b/src/Native/Unix/System.Native/pal_io.c index 5a5fb824e6..f95a18a5de 100644 --- a/src/Native/Unix/System.Native/pal_io.c +++ b/src/Native/Unix/System.Native/pal_io.c @@ -1131,7 +1131,11 @@ int32_t SystemNative_Read(intptr_t fd, void* buffer, int32_t bufferSize) } ssize_t count; +#if !MONO while ((count = read(ToFileDescriptor(fd), buffer, (uint32_t)bufferSize)) < 0 && errno == EINTR); +#else // The Mono thread abort process can cause an EINTR here that needs to be handled + count = read(ToFileDescriptor(fd), buffer, (uint32_t)bufferSize); +#endif assert(count >= -1 && count <= bufferSize); return (int32_t)count; |