================
@@ -325,6 +325,44 @@ bool IsAccessibleMemoryRange(uptr beg, uptr size) {
   return true;
 }
 
+bool TryMemCpy(void *dest, const void *src, uptr n) {
+  int sock_pair[2];
+  if (pipe(sock_pair))
+    return false;
+
+  auto cleanup = at_scope_exit([&]() {
+    internal_close(sock_pair[0]);
+    internal_close(sock_pair[1]);
+  });
+
+  SetNonBlock(sock_pair[0]);
----------------
fmayer wrote:

Actually maybe not. Because we always read after writing, so there should 
always be space in the buffer for writing, and always be data for reading.

But we need to handle EINTR.

https://github.com/llvm/llvm-project/pull/112668
_______________________________________________
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to