pt_dupfd
pt_dupfd(pt->p_stdin, O_RDWR, 0, STDIN_FILENO);
pt_dupfd(pt->p_stdout, O_CREAT | O_WRONLY, 0666, STDOUT_FILENO);