See commit 41b1792698a335d3a85381921a84a16e9635f36a for testcase.
Note: while this works on s390x, the s390 code hangs when using -e. But it hangs regardless of this code (the hang seems to occur before the exit func is even called). I didn't look too closely at it as it seems to be an issue external to this file, so this code shouldn't make the situation any worse.
7a02cfa s390: implement sotruss support
ChangeLog | 4 +++
sysdeps/s390/sotruss-lib.c | 62 ++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 66 insertions(+)
Upstream: sourceware.org