From: David CARLIER Date: Thu, 18 Feb 2021 15:26:20 +0000 (+0000) Subject: bpo-42960: Add resource.RLIMIT_KQUEUES constant from FreeBSD (GH-24251) X-Git-Tag: v3.10.0a6~74 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7be00ee64a2ced73c00ec855c7265e2ba795213d;p=thirdparty%2FPython%2Fcpython.git bpo-42960: Add resource.RLIMIT_KQUEUES constant from FreeBSD (GH-24251) --- diff --git a/Doc/library/resource.rst b/Doc/library/resource.rst index e4eac43642d1..00ff3b5dd3b6 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 000000000000..58c1bcc85ef7 --- /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 f10a80f47768..0d69c2983b4d 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);