summaryrefslogtreecommitdiffstats
path: root/Modules/fcntlmodule.c
diff options
context:
space:
mode:
authorIllia Volochii <illia.volochii@gmail.com>2022-06-06 21:21:58 (GMT)
committerGitHub <noreply@github.com>2022-06-06 21:21:58 (GMT)
commitd1e2e0e1b2af10ddecc5a6a0f9f4ab19ee8a0036 (patch)
tree14f5085f9ea00d70298f51dd776deacbbf1635d4 /Modules/fcntlmodule.c
parent46fde1feb5fce0f8711ff8c0e1bab317b580d387 (diff)
downloadcpython-d1e2e0e1b2af10ddecc5a6a0f9f4ab19ee8a0036.zip
cpython-d1e2e0e1b2af10ddecc5a6a0f9f4ab19ee8a0036.tar.gz
cpython-d1e2e0e1b2af10ddecc5a6a0f9f4ab19ee8a0036.tar.bz2
gh-93475: Expose FICLONE and FICLONERANGE constants in fcntl (#93478)
Diffstat (limited to 'Modules/fcntlmodule.c')
-rw-r--r--Modules/fcntlmodule.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/Modules/fcntlmodule.c b/Modules/fcntlmodule.c
index ea9b2bc..9a8ec8d 100644
--- a/Modules/fcntlmodule.c
+++ b/Modules/fcntlmodule.c
@@ -8,6 +8,9 @@
#ifdef HAVE_SYS_FILE_H
#include <sys/file.h>
#endif
+#ifdef HAVE_LINUX_FS_H
+#include <linux/fs.h>
+#endif
#include <sys/ioctl.h>
#include <fcntl.h>
@@ -572,6 +575,12 @@ all_ins(PyObject* m)
#ifdef F_GETPIPE_SZ
if (PyModule_AddIntMacro(m, F_GETPIPE_SZ)) return -1;
#endif
+#ifdef FICLONE
+ if (PyModule_AddIntMacro(m, FICLONE)) return -1;
+#endif
+#ifdef FICLONERANGE
+ if (PyModule_AddIntMacro(m, FICLONERANGE)) return -1;
+#endif
/* OS X specifics */
#ifdef F_FULLFSYNC