bpo-46315: Add ifdef HAVE_ feature checks for WASI compatibility (GH-30507)

This commit is contained in:
Christian Heimes 2022-01-13 10:46:04 +02:00 committed by GitHub
parent 1de60155d5
commit a6ca8eee22
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 90 additions and 14 deletions

View file

@ -3292,7 +3292,14 @@ os_chmod_impl(PyObject *module, path_t *path, int mode, int dir_fd,
}
else
#endif /* HAVE_FHCMODAT */
{
#ifdef HAVE_CHMOD
result = chmod(path->narrow, mode);
#else
result = -1;
errno = ENOSYS;
#endif
}
Py_END_ALLOW_THREADS
if (result) {
@ -4885,6 +4892,7 @@ os_system_impl(PyObject *module, PyObject *command)
#endif /* HAVE_SYSTEM */
#ifdef HAVE_UMASK
/*[clinic input]
os.umask
@ -4903,6 +4911,7 @@ os_umask_impl(PyObject *module, int mask)
return posix_error();
return PyLong_FromLong((long)i);
}
#endif
#ifdef MS_WINDOWS