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

This commit is contained in:
David CARLIER 2021-02-18 15:26:20 +00:00 committed by GitHub
parent a3c3ffa68e
commit 7be00ee64a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 0 deletions

View 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
--------------

View File

@ -0,0 +1 @@
Adds :data:`resource.RLIMIT_KQUEUES` constant from FreeBSD to the :mod:`resource` module.

View 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);