diff --git a/Doc/library/resource.rst b/Doc/library/resource.rst index e4eac43642d..00ff3b5dd3b 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 00000000000..58c1bcc85ef --- /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 f10a80f4776..0d69c2983b4 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);