aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2010-04-14 07:03:55 +0200
committerNguyễn Thái Ngọc Duy <pclouds@gmail.com>2010-04-20 19:14:06 +0200
commit7fdc134ff7ca4f6c9db5259a95e55cfeeeee8bfd (patch)
treeaee7453a889b8ac10ce47faa41af840285be8adf
parent7f73d1848602da4c714045cbffbd27a3aa91c976 (diff)
downloadbusybox-w32-7fdc134ff7ca4f6c9db5259a95e55cfeeeee8bfd.tar.gz
busybox-w32-7fdc134ff7ca4f6c9db5259a95e55cfeeeee8bfd.tar.bz2
busybox-w32-7fdc134ff7ca4f6c9db5259a95e55cfeeeee8bfd.zip
win32: add waitpid()
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
-rw-r--r--include/mingw.h2
-rw-r--r--win32/Kbuild1
-rw-r--r--win32/process.c10
3 files changed, 12 insertions, 1 deletions
diff --git a/include/mingw.h b/include/mingw.h
index 5cc1c5df5..bfe21137d 100644
--- a/include/mingw.h
+++ b/include/mingw.h
@@ -219,7 +219,7 @@ int setitimer(int type, struct itimerval *in, struct itimerval *out);
219 * sys/wait.h 219 * sys/wait.h
220 */ 220 */
221#define WNOHANG 1 221#define WNOHANG 1
222NOIMPL(waitpid,pid_t pid UNUSED_PARAM, int *status UNUSED_PARAM, unsigned options UNUSED_PARAM); 222int waitpid(pid_t pid, int *status, unsigned options);
223 223
224/* 224/*
225 * time.h 225 * 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
7lib-$(CONFIG_PLATFORM_MINGW32) += fnmatch.o 7lib-$(CONFIG_PLATFORM_MINGW32) += fnmatch.o
8lib-$(CONFIG_PLATFORM_MINGW32) += mingw.o 8lib-$(CONFIG_PLATFORM_MINGW32) += mingw.o
9lib-$(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
3int 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}