Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/corefx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexis Christoforides <alexis@thenull.net>2018-06-02 13:02:30 +0300
committerMarek Safar <marek.safar@gmail.com>2018-06-20 17:44:11 +0300
commit17804432d376b3ef6bf6db4edaa68a910b18e1b1 (patch)
tree236eb67739d00d57828b2903a5603d1c849ee9a2
parented31064357cf8decf4316181810461bb11561dc1 (diff)
Use icall for blocking read call in Mono
-rw-r--r--src/Native/Unix/System.Native/pal_io.c4
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;