SUMMARY The syscall wrapper for socketpair returns success if the emulated resource limit for open files is exhausted. It should fail with error EMFILE. STEPS TO REPRODUCE 1. Compile the following test program: #include <stdio.h> #include <sys/resource.h> #include <sys/socket.h> #include <unistd.h> int main() { struct rlimit lim; getrlimit(RLIMIT_NOFILE, &lim); lim.rlim_cur = 3; setrlimit(RLIMIT_NOFILE, &lim); int sv[2]; printf("%d\n", socketpair(AF_UNIX, SOCK_STREAM, 0, sv)); } 2. Run the compiled program with valgrind (the tool does not matter) OBSERVED RESULT Test program prints 0 EXPECTED RESULT Test program prints -1 SOFTWARE/OS VERSIONS Valgrind: 3.17.0