mirror of https://github.com/python/cpython
[3.13] gh-116622: Don't expose `FICLONE` ioctl on Android (GH-122522) (#122539)
gh-116622: Don't expose `FICLONE` ioctl on Android (GH-122522)
Don't expose `FICLONE` ioctl on Android
(cherry picked from commit 06656e259b
)
Co-authored-by: Malcolm Smith <smith@chaquo.com>
Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
This commit is contained in:
parent
a604b2440f
commit
69cf92fbca
|
@ -0,0 +1,2 @@
|
||||||
|
On Android, the ``FICLONE`` and ``FICLONERANGE`` constants are no longer
|
||||||
|
exposed by :mod:`fcntl`, as these ioctls are blocked by SELinux.
|
|
@ -580,12 +580,17 @@ all_ins(PyObject* m)
|
||||||
#ifdef F_GETPIPE_SZ
|
#ifdef F_GETPIPE_SZ
|
||||||
if (PyModule_AddIntMacro(m, F_GETPIPE_SZ)) return -1;
|
if (PyModule_AddIntMacro(m, F_GETPIPE_SZ)) return -1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* On Android, FICLONE is blocked by SELinux. */
|
||||||
|
#ifndef __ANDROID__
|
||||||
#ifdef FICLONE
|
#ifdef FICLONE
|
||||||
if (PyModule_AddIntMacro(m, FICLONE)) return -1;
|
if (PyModule_AddIntMacro(m, FICLONE)) return -1;
|
||||||
#endif
|
#endif
|
||||||
#ifdef FICLONERANGE
|
#ifdef FICLONERANGE
|
||||||
if (PyModule_AddIntMacro(m, FICLONERANGE)) return -1;
|
if (PyModule_AddIntMacro(m, FICLONERANGE)) return -1;
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef F_GETOWN_EX
|
#ifdef F_GETOWN_EX
|
||||||
// since Linux 2.6.32
|
// since Linux 2.6.32
|
||||||
if (PyModule_AddIntMacro(m, F_GETOWN_EX)) return -1;
|
if (PyModule_AddIntMacro(m, F_GETOWN_EX)) return -1;
|
||||||
|
|
Loading…
Reference in New Issue