[Python-checkins] bpo-42960: Add resource.RLIMIT_KQUEUES constant from FreeBSD (GH-24251)

vstinner webhook-mailer at python.org
Thu Feb 18 10:26:29 EST 2021


https://github.com/python/cpython/commit/7be00ee64a2ced73c00ec855c7265e2ba795213d
commit: 7be00ee64a2ced73c00ec855c7265e2ba795213d
branch: master
author: David CARLIER <devnexen at gmail.com>
committer: vstinner <vstinner at python.org>
date: 2021-02-18T16:26:20+01:00
summary:

bpo-42960: Add resource.RLIMIT_KQUEUES constant from FreeBSD (GH-24251)

files:
A Misc/NEWS.d/next/Library/2021-01-18-21-07-20.bpo-42960.a7Dote.rst
M Doc/library/resource.rst
M Modules/resource.c

diff --git a/Doc/library/resource.rst b/Doc/library/resource.rst
index e4eac43642d14..00ff3b5dd3b6a 100644
--- a/Doc/library/resource.rst
+++ b/Doc/library/resource.rst
@@ -255,6 +255,14 @@ platform.
 
    .. versionadded:: 3.4
 
+.. data:: RLIMIT_KQUEUES
+
+   The maximum number of kqueues this user id is allowed to create.
+
+   .. availability:: FreeBSD 11 or later.
+
+   .. versionadded:: 3.10
+
 Resource Usage
 --------------
 
diff --git a/Misc/NEWS.d/next/Library/2021-01-18-21-07-20.bpo-42960.a7Dote.rst b/Misc/NEWS.d/next/Library/2021-01-18-21-07-20.bpo-42960.a7Dote.rst
new file mode 100644
index 0000000000000..58c1bcc85ef70
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2021-01-18-21-07-20.bpo-42960.a7Dote.rst
@@ -0,0 +1 @@
+Adds :data:`resource.RLIMIT_KQUEUES` constant from FreeBSD to the :mod:`resource` module.
diff --git a/Modules/resource.c b/Modules/resource.c
index f10a80f477686..0d69c2983b4d1 100644
--- a/Modules/resource.c
+++ b/Modules/resource.c
@@ -480,6 +480,10 @@ resource_exec(PyObject *module)
     ADD_INT(module, RLIMIT_NPTS);
 #endif
 
+#ifdef RLIMIT_KQUEUES
+    ADD_INT(module, RLIMIT_KQUEUES);
+#endif
+
     PyObject *v;
     if (sizeof(RLIM_INFINITY) > sizeof(long)) {
         v = PyLong_FromLongLong((long long) RLIM_INFINITY);



More information about the Python-checkins mailing list