+size_t wxProcessFileInputStream::OnSysRead(void *buffer, size_t bufsize)
+{
+ int ret;
+
+ ret = read(m_fd, buffer, bufsize);
+ m_lasterror = wxSTREAM_NOERROR;
+ if (ret == 0)
+ m_lasterror = wxSTREAM_EOF;
+ if (ret == -1) {
+ m_lasterror = wxSTREAM_READ_ERROR;
+ ret = 0;
+ }
+ return ret;
+}
+
+wxProcessFileOutputStream::wxProcessFileOutputStream(int fd)
+{
+ m_fd = fd;
+}
+
+wxProcessFileOutputStream::~wxProcessFileOutputStream()
+{
+ close(m_fd);
+}
+
+size_t wxProcessFileOutputStream::OnSysWrite(const void *buffer, size_t bufsize)
+{
+ int ret;
+
+ ret = write(m_fd, buffer, bufsize);
+ m_lasterror = wxSTREAM_NOERROR;
+ if (ret == -1) {
+ m_lasterror = wxSTREAM_WRITE_ERROR;
+ ret = 0;
+ }
+ return ret;
+}
+
+#endif
+
+long wxExecute(wxChar **argv,
+ bool sync,
+ wxProcess * WXUNUSED_UNLESS_GUI(process))
+{
+ wxCHECK_MSG( *argv, 0, wxT("can't exec empty command") );
+
+#if wxUSE_UNICODE
+ int mb_argc = 0;
+ char *mb_argv[WXEXECUTE_NARGS];