一个重指向的应用

已经运行并默认输出到tty的pid,使用gdb修改 STDOUT/STDERR,

  • attach to the process in question using gdb, and run:
p dup2(open("/dev/null", 0), 1)
p dup2(open("/dev/null", 0), 2)
detach
quit