|
|||||||
|
How can a process intercept stdout and stderr of another process on Linux?
Время создания: 24.11.2014 15:47
Раздел: root - Linux
Запись: Yurons/mytetra/master/base/1416833276ulty8tkqkn/text.html на raw.githubusercontent.com
|
|||||||
|
|
|||||||
|
Now, attach gdb: gdb -p (pid)
and do the fd magic: (gdb) call creat("/tmp/stdout", 0600)
$1 = 3
(gdb) call dup2(3, 1)
$2 = 1
Now you can tail /tmp/stdout and see the output that used to go to stdout. |