From a85653040477ec4e8a722de3af5afd04ee66bd59 Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Mon, 7 Jan 2019 07:54:40 +0000 Subject: 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. --- include/mingw.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include') 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 #define S_IWOTH (S_IWGRP >> 3) #define S_IXOTH (S_IXGRP >> 3) +mode_t mingw_umask(mode_t mode); +#define umask mingw_umask + +#define DEFAULT_UMASK 0002 + IMPL(fchmod,int,0,int fildes UNUSED_PARAM, mode_t mode UNUSED_PARAM); NOIMPL(fchown,int fd UNUSED_PARAM, uid_t uid UNUSED_PARAM, gid_t gid UNUSED_PARAM); int mingw_mkdir(const char *path, int mode); -- cgit v1.2.3-55-g6feb