#include <unistd.h> int main(int argc, char **argv) { dup3 (0, 0, 0); return 0; } ==62394== Command: ./dup3 ==62394== --62394-- WARNING: unhandled syscall: 326 --62394-- You may be able to write your own handler. --62394-- Read the file README_MISSING_SYSCALL_OR_IOCTL. --62394-- Nevertheless we consider this a bug. Please report --62394-- it at http://valgrind.org/support/bug_reports.html. Looks like the fix might be as simple as: diff --git a/coregrind/m_syswrap/syswrap-s390x-linux.c b/coregrind/m_syswrap/syswrap-s390x-linux.c index 8bbdf3d..2de367a 100644 --- a/coregrind/m_syswrap/syswrap-s390x-linux.c +++ b/coregrind/m_syswrap/syswrap-s390x-linux.c @@ -1044,7 +1044,7 @@ static SyscallTableEntry syscall_table[] = { LINXY(__NR_inotify_init1, sys_inotify_init1), // 324 LINXY(__NR_pipe2, sys_pipe2), // 325 - // (__NR_dup3, ), + LINXY(__NR_dup3, sys_dup3), // 326 LINXY(__NR_epoll_create1, sys_epoll_create1), // 327 LINXY(__NR_preadv, sys_preadv), // 328 LINX_(__NR_pwritev, sys_pwritev), // 329 Which is how all other arches wrap dup3. Reproducible: Always
Some testing revealed the above patch is indeed all that is needed. Fixed as valgrind commit r13820