From 0599746d9bcf513c4898cbd1a46ef1d5b3478627 Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Wed, 30 Aug 2017 16:57:45 +0100 Subject: win32: make vfork fail at compile-time Nothing in busybox-w32 uses fork. Remove the implementations of fork, vfork and xvfork so that, for example, enabling cpio pass-through causes an error at compile-time, not run-time. MinGW-w64 defines pid_t, so we don't have to. Ensure code containing xvfork in netcat is disabled when NC_EXTRA is disabled. Otherwise removing the implementation of vfork costs 64 bytes. --- include/mingw.h | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'include/mingw.h') diff --git a/include/mingw.h b/include/mingw.h index ff5e8ee1e..d7dabacaf 100644 --- a/include/mingw.h +++ b/include/mingw.h @@ -7,11 +7,6 @@ */ typedef int gid_t; typedef int uid_t; -#ifndef _WIN64 -typedef int pid_t; -#else -typedef __int64 pid_t; -#endif #define DEFAULT_UID 1000 #define DEFAULT_GID 1000 @@ -397,7 +392,6 @@ NOIMPL(getsid,pid_t pid UNUSED_PARAM); IMPL(getuid,int,DEFAULT_UID,void); int getlogin_r(char *buf, size_t len); int fcntl(int fd, int cmd, ...); -#define fork() -1 IMPL(fsync,int,0,int fd UNUSED_PARAM); int kill(pid_t pid, int sig); int link(const char *oldpath, const char *newpath); @@ -417,7 +411,7 @@ long sysconf(int name); IMPL(getpagesize,int,4096,void); NOIMPL(ttyname_r,int fd UNUSED_PARAM, char *buf UNUSED_PARAM, int sz UNUSED_PARAM); int mingw_unlink(const char *pathname); -NOIMPL(vfork,void); +pid_t vfork(void); int mingw_access(const char *name, int mode); int mingw_rmdir(const char *name); int mingw_isatty(int fd); -- cgit v1.2.3-55-g6feb