diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2010-04-14 07:03:55 +0200 |
---|---|---|
committer | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2010-09-10 18:40:48 +1000 |
commit | 8677ef15d85c1e0b713c4f97979c696580bcc4f7 (patch) | |
tree | f123db1d5aa8f0a4983c8ee7d7c43cce2ec86c38 | |
parent | 1223cf253536c4b9ac169019a30bed1fd5adf22e (diff) | |
download | busybox-w32-8677ef15d85c1e0b713c4f97979c696580bcc4f7.tar.gz busybox-w32-8677ef15d85c1e0b713c4f97979c696580bcc4f7.tar.bz2 busybox-w32-8677ef15d85c1e0b713c4f97979c696580bcc4f7.zip |
win32: add waitpid()
-rw-r--r-- | include/mingw.h | 2 | ||||
-rw-r--r-- | win32/Kbuild | 1 | ||||
-rw-r--r-- | win32/process.c | 10 |
3 files changed, 12 insertions, 1 deletions
diff --git a/include/mingw.h b/include/mingw.h index e59e6322c..70b679674 100644 --- a/include/mingw.h +++ b/include/mingw.h | |||
@@ -218,7 +218,7 @@ int setitimer(int type, struct itimerval *in, struct itimerval *out); | |||
218 | * sys/wait.h | 218 | * sys/wait.h |
219 | */ | 219 | */ |
220 | #define WNOHANG 1 | 220 | #define WNOHANG 1 |
221 | NOIMPL(waitpid,pid_t pid UNUSED_PARAM, int *status UNUSED_PARAM, unsigned options UNUSED_PARAM); | 221 | int waitpid(pid_t pid, int *status, unsigned options); |
222 | 222 | ||
223 | /* | 223 | /* |
224 | * time.h | 224 | * time.h |
diff --git a/win32/Kbuild b/win32/Kbuild index 85f5ca7c4..22f8252d0 100644 --- a/win32/Kbuild +++ b/win32/Kbuild | |||
@@ -6,3 +6,4 @@ lib-y:= | |||
6 | 6 | ||
7 | lib-$(CONFIG_PLATFORM_MINGW32) += fnmatch.o | 7 | lib-$(CONFIG_PLATFORM_MINGW32) += fnmatch.o |
8 | lib-$(CONFIG_PLATFORM_MINGW32) += mingw.o | 8 | lib-$(CONFIG_PLATFORM_MINGW32) += mingw.o |
9 | lib-$(CONFIG_PLATFORM_MINGW32) += process.o | ||
diff --git a/win32/process.c b/win32/process.c new file mode 100644 index 000000000..77d19fb9a --- /dev/null +++ b/win32/process.c | |||
@@ -0,0 +1,10 @@ | |||
1 | #include "libbb.h" | ||
2 | |||
3 | int waitpid(pid_t pid, int *status, unsigned options) | ||
4 | { | ||
5 | /* Windows does not understand parent-child */ | ||
6 | if (options == 0 && pid != -1) | ||
7 | return _cwait(status, pid, 0); | ||
8 | errno = EINVAL; | ||
9 | return -1; | ||
10 | } | ||