diff options
author | Ron Yorston <rmy@pobox.com> | 2017-08-30 16:57:45 +0100 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2017-08-30 17:09:57 +0100 |
commit | 0599746d9bcf513c4898cbd1a46ef1d5b3478627 (patch) | |
tree | e9e64f90efef836b22b404bbe351032cd14a8050 /include/mingw.h | |
parent | 002f3c9ea19a1cd68294d905f566be5b615a9bef (diff) | |
download | busybox-w32-0599746d9bcf513c4898cbd1a46ef1d5b3478627.tar.gz busybox-w32-0599746d9bcf513c4898cbd1a46ef1d5b3478627.tar.bz2 busybox-w32-0599746d9bcf513c4898cbd1a46ef1d5b3478627.zip |
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.
Diffstat (limited to 'include/mingw.h')
-rw-r--r-- | include/mingw.h | 8 |
1 files changed, 1 insertions, 7 deletions
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 @@ | |||
7 | */ | 7 | */ |
8 | typedef int gid_t; | 8 | typedef int gid_t; |
9 | typedef int uid_t; | 9 | typedef int uid_t; |
10 | #ifndef _WIN64 | ||
11 | typedef int pid_t; | ||
12 | #else | ||
13 | typedef __int64 pid_t; | ||
14 | #endif | ||
15 | 10 | ||
16 | #define DEFAULT_UID 1000 | 11 | #define DEFAULT_UID 1000 |
17 | #define DEFAULT_GID 1000 | 12 | #define DEFAULT_GID 1000 |
@@ -397,7 +392,6 @@ NOIMPL(getsid,pid_t pid UNUSED_PARAM); | |||
397 | IMPL(getuid,int,DEFAULT_UID,void); | 392 | IMPL(getuid,int,DEFAULT_UID,void); |
398 | int getlogin_r(char *buf, size_t len); | 393 | int getlogin_r(char *buf, size_t len); |
399 | int fcntl(int fd, int cmd, ...); | 394 | int fcntl(int fd, int cmd, ...); |
400 | #define fork() -1 | ||
401 | IMPL(fsync,int,0,int fd UNUSED_PARAM); | 395 | IMPL(fsync,int,0,int fd UNUSED_PARAM); |
402 | int kill(pid_t pid, int sig); | 396 | int kill(pid_t pid, int sig); |
403 | int link(const char *oldpath, const char *newpath); | 397 | int link(const char *oldpath, const char *newpath); |
@@ -417,7 +411,7 @@ long sysconf(int name); | |||
417 | IMPL(getpagesize,int,4096,void); | 411 | IMPL(getpagesize,int,4096,void); |
418 | NOIMPL(ttyname_r,int fd UNUSED_PARAM, char *buf UNUSED_PARAM, int sz UNUSED_PARAM); | 412 | NOIMPL(ttyname_r,int fd UNUSED_PARAM, char *buf UNUSED_PARAM, int sz UNUSED_PARAM); |
419 | int mingw_unlink(const char *pathname); | 413 | int mingw_unlink(const char *pathname); |
420 | NOIMPL(vfork,void); | 414 | pid_t vfork(void); |
421 | int mingw_access(const char *name, int mode); | 415 | int mingw_access(const char *name, int mode); |
422 | int mingw_rmdir(const char *name); | 416 | int mingw_rmdir(const char *name); |
423 | int mingw_isatty(int fd); | 417 | int mingw_isatty(int fd); |