diff -r 4b6e6a77e501 Modules/clinic/posixmodule.c.h --- a/Modules/clinic/posixmodule.c.h Sat Oct 22 03:21:55 2016 +0000 +++ b/Modules/clinic/posixmodule.c.h Sat Oct 22 07:19:27 2016 +0200 @@ -1411,6 +1411,8 @@ #endif /* defined(HAVE_SYSTEM) && !defined(MS_WINDOWS) */ +#if (defined(MS_WINDOWS) || defined(HAVE_UMASK)) + PyDoc_STRVAR(os_umask__doc__, "umask($module, mask, /)\n" "--\n" @@ -1438,6 +1440,8 @@ return return_value; } +#endif /* (defined(MS_WINDOWS) || defined(HAVE_UMASK)) */ + PyDoc_STRVAR(os_unlink__doc__, "unlink($module, /, path, *, dir_fd=None)\n" "--\n" @@ -5757,6 +5761,10 @@ #define OS_SYSTEM_METHODDEF #endif /* !defined(OS_SYSTEM_METHODDEF) */ +#ifndef OS_UMASK_METHODDEF + #define OS_UMASK_METHODDEF +#endif /* !defined(OS_UMASK_METHODDEF) */ + #ifndef OS_UNAME_METHODDEF #define OS_UNAME_METHODDEF #endif /* !defined(OS_UNAME_METHODDEF) */ diff -r 4b6e6a77e501 Modules/posixmodule.c --- a/Modules/posixmodule.c Sat Oct 22 03:21:55 2016 +0000 +++ b/Modules/posixmodule.c Sat Oct 22 07:19:27 2016 +0200 @@ -4141,6 +4141,7 @@ #endif /* HAVE_SYSTEM */ +#if defined(MS_WINDOWS) || defined(HAVE_UMASK) /*[clinic input] os.umask @@ -4159,6 +4160,7 @@ return posix_error(); return PyLong_FromLong((long)i); } +#endif /* MS_WINDOWS || HAVE_UMASK */ #ifdef MS_WINDOWS diff -r 4b6e6a77e501 configure.ac --- a/configure.ac Sat Oct 22 03:21:55 2016 +0000 +++ b/configure.ac Sat Oct 22 07:19:27 2016 +0200 @@ -3422,8 +3422,8 @@ sigaction sigaltstack siginterrupt sigpending sigrelse \ sigtimedwait sigwait sigwaitinfo snprintf strftime strlcpy symlinkat sync \ sysconf tcgetpgrp tcsetpgrp tempnam timegm times tmpfile tmpnam tmpnam_r \ - truncate uname unlinkat unsetenv utimensat utimes waitid waitpid wait3 wait4 \ - wcscoll wcsftime wcsxfrm wmemcmp writev _getpty) + truncate umask uname unlinkat unsetenv utimensat utimes waitid waitpid wait3 \ + wait4 wcscoll wcsftime wcsxfrm wmemcmp writev _getpty) AC_CHECK_DECL(dirfd, AC_DEFINE(HAVE_DIRFD, 1,