```cpp #include #include #include int main() { int fds[2]; int flags; if (pipe(fds) != 0) { printf("pipe failed: errno is %d (%s)\n", errno, strerror(errno)); return false; } flags = fcntl(fds[0], F_GETFL, 0); fcntl(fds[0], F_SETFL, flags | O_NONBLOCK); flags = fcntl(fds[1], F_GETFL, 0); fcntl(fds[1], F_SETFL, flags | O_NONBLOCK); const int size = 4096; void* ptr = mmap(nullptr, size, PROT_NONE, MAP_ANON | MAP_PRIVATE, -1, 0); // Crashes // std::cout << "Pointer value is: " << std::flush << *(int*)ptr << std::endl; // Still returns 1, expected -1 std::cout << write(fds[1], ptr, 1) << std::endl; // false, expected true std::cout << std::boolalpha << (errno == EFAULT) << std::noboolalpha << std::endl; // -1 as expected std::cout << write(fds[1], (void*)0xDEADBEEF, 1) << std::endl; // true as expected. std::cout << std::boolalpha << (errno == EFAULT) << std::noboolalpha << std::endl; return 0; } ``` Why is `write` still succeeding on Haiku when I pass an allocated memory buffer I cannot read from? Is this expected for Haiku?