#include <process.h>
#include <windows.h>
#define popen _popen
+#define pclose _pclose
#endif /* NT */
#ifdef OS2
return NULL;
}
+#ifndef NT
static object *
posix_fork(self, args)
object *self;
return NULL;
return newintobject((long)geteuid());
}
+#endif /* !NT */
static object *
posix_getgid(self, args)
#endif /* HAVE_SETPGRP */
+#ifndef NT
static object *
posix_getppid(self, args)
object *self;
INCREF(None);
return None;
}
+#endif /* !NT */
static object *
posix_popen(self, args)
}
#endif /* HAVE_WAITPID */
+#ifndef NT
static object *
posix_wait(self, args)
object *self;
else
return mkvalue("ii", pid, sts);
}
+#endif /* !NT */
static object *
posix_lstat(self, args)
object *self;
object *args;
{
+#ifndef NT
int fds[2];
int res;
if (!getargs(args, ""))
if (res != 0)
return posix_error();
return mkvalue("(ii)", fds[0], fds[1]);
+#else /* NT */
+ HANDLE read, write;
+ BOOL ok;
+ if (!getargs(args, ""))
+ return NULL;
+ BGN_SAVE
+ ok = CreatePipe( &read, &write, NULL, 0);
+ END_SAVE
+ if (!ok)
+ return posix_error();
+ return mkvalue("(ii)", read, write);
+#endif /* NT */
}
static struct methodlist posix_methods[] = {
{"write", posix_write},
{"fstat", posix_fstat},
{"fdopen", posix_fdopen},
-#ifndef NT
{"pipe", posix_pipe},
-#endif /* !NT */
-
{NULL, NULL} /* Sentinel */
};