]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-42960: Add resource.RLIMIT_KQUEUES constant from FreeBSD (GH-24251)
authorDavid CARLIER <devnexen@gmail.com>
Thu, 18 Feb 2021 15:26:20 +0000 (15:26 +0000)
committerGitHub <noreply@github.com>
Thu, 18 Feb 2021 15:26:20 +0000 (16:26 +0100)
Doc/library/resource.rst
Misc/NEWS.d/next/Library/2021-01-18-21-07-20.bpo-42960.a7Dote.rst [new file with mode: 0644]
Modules/resource.c

index e4eac43642d14de7e64e3a6415ac0ff79f0a784d..00ff3b5dd3b6a342cd73d04309b45f0954bcbe1b 100644 (file)
@@ -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 (file)
index 0000000..58c1bcc
--- /dev/null
@@ -0,0 +1 @@
+Adds :data:`resource.RLIMIT_KQUEUES` constant from FreeBSD to the :mod:`resource` module.
index f10a80f4776863eef7c1fa2e9717d213c7d9e858..0d69c2983b4d18eeebb41bf838e21d9ddb71bf29 100644 (file)
@@ -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);