81#if defined (__CYGWIN__) || defined (__MINGW32__) || defined (_MSC_VER)
86 m_f = (octave::popen (command, (mode & std::ios::in) ?
"r" :
"w"));
97 if (mode & std::ios::out)
102#elif defined (HAVE_UNISTD_H)
106 int child_std_end = (mode & std::ios::in) ? 1 : 0;
108 int parent_end, child_end;
113 if (octave::sys::pipe (pipe_fds) < 0)
116 if (mode & std::ios::in)
118 parent_end = pipe_fds[0];
119 child_end = pipe_fds[1];
123 parent_end = pipe_fds[1];
124 child_end = pipe_fds[0];
133 if (child_end != child_std_end)
141 FILE *fp = procbuf_list->
m_f;
149 procbuf_list = procbuf_list->
m_next;
152 execl (
SHELL_PATH,
"sh",
"-c", command,
static_cast<void *
> (
nullptr));
165 m_f = (::fdopen (parent_end, (mode & std::ios::in) ?
"r" :
"w"));
167 if (mode & std::ios::out)
168 ::setvbuf (
m_f,
nullptr, _IOLBF,
BUFSIZ);