diff options
author | Ron Yorston <rmy@pobox.com> | 2019-01-07 07:54:40 +0000 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2019-01-07 07:54:40 +0000 |
commit | a85653040477ec4e8a722de3af5afd04ee66bd59 (patch) | |
tree | 22c36324fd4cf68764f0df846321bc5a12a611fb /include | |
parent | 1fec4ebbdb930f6b8989be2e10c0f673803ac830 (diff) | |
download | busybox-w32-a85653040477ec4e8a722de3af5afd04ee66bd59.tar.gz busybox-w32-a85653040477ec4e8a722de3af5afd04ee66bd59.tar.bz2 busybox-w32-a85653040477ec4e8a722de3af5afd04ee66bd59.zip |
win32: implement umask(2)
umask() in the Microsoft C runtime takes different arguments to
umask(2). Implement a fake umask(2) that remembers the mask and
calls the Microsoft umask() with an appropriate value.
Since the mask won't be inherited by children use an environment
variable to pass any value set by the shell built-in umask.
Diffstat (limited to 'include')
-rw-r--r-- | include/mingw.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/mingw.h b/include/mingw.h index b712e4ec0..2dc3ddfd7 100644 --- a/include/mingw.h +++ b/include/mingw.h | |||
@@ -243,6 +243,11 @@ NOIMPL(mingw_sendto,SOCKET s UNUSED_PARAM, const char *buf UNUSED_PARAM, int len | |||
243 | #define S_IWOTH (S_IWGRP >> 3) | 243 | #define S_IWOTH (S_IWGRP >> 3) |
244 | #define S_IXOTH (S_IXGRP >> 3) | 244 | #define S_IXOTH (S_IXGRP >> 3) |
245 | 245 | ||
246 | mode_t mingw_umask(mode_t mode); | ||
247 | #define umask mingw_umask | ||
248 | |||
249 | #define DEFAULT_UMASK 0002 | ||
250 | |||
246 | IMPL(fchmod,int,0,int fildes UNUSED_PARAM, mode_t mode UNUSED_PARAM); | 251 | IMPL(fchmod,int,0,int fildes UNUSED_PARAM, mode_t mode UNUSED_PARAM); |
247 | NOIMPL(fchown,int fd UNUSED_PARAM, uid_t uid UNUSED_PARAM, gid_t gid UNUSED_PARAM); | 252 | NOIMPL(fchown,int fd UNUSED_PARAM, uid_t uid UNUSED_PARAM, gid_t gid UNUSED_PARAM); |
248 | int mingw_mkdir(const char *path, int mode); | 253 | int mingw_mkdir(const char *path, int mode); |