Bug 331337 - s390x WARNING: unhandled syscall: 326 (dup3)
Summary: s390x WARNING: unhandled syscall: 326 (dup3)
Status: RESOLVED FIXED
Alias: None
Product: valgrind
Classification: Developer tools
Component: general (show other bugs)
Version: 3.9.0
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-20 15:04 UTC by Mark Wielaard
Modified: 2014-02-20 15:43 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Wielaard 2014-02-20 15:04:28 UTC
#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
Comment 1 Mark Wielaard 2014-02-20 15:43:30 UTC
Some testing revealed the above patch is indeed all that is needed.
Fixed as valgrind commit r13820