Under Linux I often use /proc/<pid>/fd/[0,1,2] to access std[in,out,err] of any running process.Is there a way to achieve the same result under FreeBSD and/or macOS ?
Grab standard input/ouput of a running process under FreeBSD/macOS
process;osx;freebsd;open files
See this StackOverflow link for a dtrace based answer to this. I've tested it on FreeBSD and it works perfectly:    capture() {        sudo dtrace -p $1 -qn '            syscall::write*:entry            /pid == $target && arg0 == 1/ {                printf(%s, copyinstr(arg1, arg2));            }           '       }   