82#if defined (__CYGWIN__) || defined (__MINGW32__) || defined (_MSC_VER)
87 m_f = (octave::popen (command, (mode & std::ios::in) ?
"r" :
"w"));
98 if (mode & std::ios::out)
103#elif defined (HAVE_UNISTD_H)
107 int child_std_end = (mode & std::ios::in) ? 1 : 0;
109 int parent_end, child_end;
114 if (octave::sys::pipe (pipe_fds) < 0)
117 if (mode & std::ios::in)
119 parent_end = pipe_fds[0];
120 child_end = pipe_fds[1];
124 parent_end = pipe_fds[1];
125 child_end = pipe_fds[0];
134 if (child_end != child_std_end)
142 FILE *fp = procbuf_list->
m_f;
150 procbuf_list = procbuf_list->
m_next;
153 execl (
SHELL_PATH,
"sh",
"-c", command,
static_cast<void *
> (
nullptr));
166 m_f = (::fdopen (parent_end, (mode & std::ios::in) ?
"r" :
"w"));
168 if (mode & std::ios::out)
169 ::setvbuf (
m_f,
nullptr, _IOLBF,
BUFSIZ);