From eefbe3a047b640b861f3e78cb036cd70b9c5790e Mon Sep 17 00:00:00 2001 From: Nguyễn Thái Ngọc Duy Date: Wed, 14 Apr 2010 06:55:36 +0200 Subject: win32: add pipe() --- include/mingw.h | 2 +- win32/mingw.c | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/include/mingw.h b/include/mingw.h index 75f70e5ef..45bd32df1 100644 --- a/include/mingw.h +++ b/include/mingw.h @@ -256,7 +256,7 @@ IMPL(fsync,int,0,int fd UNUSED_PARAM); NOIMPL(kill,pid_t pid UNUSED_PARAM, int sig UNUSED_PARAM); NOIMPL(link,const char *oldpath UNUSED_PARAM, const char *newpath UNUSED_PARAM); NOIMPL(mknod,const char *name UNUSED_PARAM, mode_t mode UNUSED_PARAM, dev_t device UNUSED_PARAM); -NOIMPL(pipe,int filedes[2] UNUSED_PARAM); +int pipe(int filedes[2]); NOIMPL(readlink,const char *path UNUSED_PARAM, char *buf UNUSED_PARAM, size_t bufsiz UNUSED_PARAM); NOIMPL(setgid,gid_t gid UNUSED_PARAM); NOIMPL(setsid,void); diff --git a/win32/mingw.c b/win32/mingw.c index 020e9c420..09d746f21 100644 --- a/win32/mingw.c +++ b/win32/mingw.c @@ -55,3 +55,10 @@ int gettimeofday(struct timeval *tv, void *tz) tv->tv_usec = st.wMilliseconds*1000; return 0; } + +int pipe(int filedes[2]) +{ + if (_pipe(filedes, PIPE_BUF, 0) < 0) + return -1; + return 0; +} -- cgit v1.2.3-55-g6feb