[RFC PATCH 13/15] Implement printfd_pid_tracee_ns

Ákos Uzonyi uzonyi.akos at gmail.com
Mon Jun 1 11:44:42 UTC 2020


* util.c (printfd_pid_tracee_ns): Implement function correctly.
---
 util.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/util.c b/util.c
index 59696b58..828b4e92 100644
--- a/util.c
+++ b/util.c
@@ -641,12 +641,8 @@ printed:
 void
 printfd_pid_tracee_ns(struct tcb *tcp, pid_t pid, int fd)
 {
-	/*
-	 * TODO: We want to have the same formatting as printfd here,
-	 *       but we should figure out first which process in strace's
-	 *       PID NS is referred to by pid in tracee's PID NS.
-	 */
-	tprintf("%d", fd);
+	int strace_pid = find_pid(tcp, pid, PT_TGID, NULL);
+	printfd_pid(tcp, strace_pid, fd);
 }
 
 /*
-- 
2.26.2



More information about the Strace-devel mailing list