From 2ac01855ce6667e9e3d23c76616eb38a73200883 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Wed, 23 Aug 2017 16:15:48 +0200 Subject: mingw: clarify that waitpid(-1, ...) is not supported When passing -1 as pid to the waitpid() function, it is supposed to wait for *any* child to exit. That is a bit tough to emulate on Windows given that waitpid() returns only one pid, and if multiple children have exited, subsequent calls to waitpid() should produce all of their pids subsequently. Oh, and we would have to figure out which processes were spawned and remember that list. And then, it would still be possible for the children to exit in the meantime and for *another* process using the pid, as Windows reuses pids very, very quickly. So let's punt and simply state that we do not support that functionality. Signed-off-by: Johannes Schindelin Signed-off-by: Ron Yorston --- win32/process.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/win32/process.c b/win32/process.c index 9ad75f94f..a0e8b96e0 100644 --- a/win32/process.c +++ b/win32/process.c @@ -15,7 +15,7 @@ int waitpid(pid_t pid, int *status, int options) return ret == -1 ? -1 : pid; } } - errno = EINVAL; + errno = pid < 0 ? ENOSYS : EINVAL; return -1; } -- cgit v1.2.3-55-g6feb