cpython: ad2cd599f1cf (original) (raw)

Mercurial > cpython

changeset 87829:ad2cd599f1cf

Issue #19343: Expose FreeBSD-specific APIs in resource module. Original patch by Koobs. [#19343]

Christian Heimes christian@cheimes.de
date Sun, 08 Dec 2013 14:35:55 +0100
parents 01676a4c16ff
children 4221d5d9ac84
files Doc/library/resource.rst Lib/test/test_resource.py Misc/NEWS Modules/resource.c
diffstat 4 files changed, 51 insertions(+), 0 deletions(-)[+] [-] Doc/library/resource.rst 28 Lib/test/test_resource.py 6 Misc/NEWS 3 Modules/resource.c 14

line wrap: on

line diff

--- a/Doc/library/resource.rst +++ b/Doc/library/resource.rst @@ -217,6 +217,34 @@ platform. .. versionadded:: 3.4 +.. data:: RLIMIT_SBSIZE +

+.. data:: RLIMIT_SWAP +

+.. data:: RLIMIT_NPTS +

Resource Usage --------------

--- a/Lib/test/test_resource.py +++ b/Lib/test/test_resource.py @@ -138,6 +138,12 @@ class ResourceTest(unittest.TestCase): with contextlib.suppress(AttributeError): self.assertIsInstance(getattr(resource, 'RLIMIT_' + attr), int)

+ @unittest.skipUnless(hasattr(resource, 'prlimit'), 'no prlimit') @support.requires_linux_version(2, 6, 36) def test_prlimit(self):

--- a/Misc/NEWS +++ b/Misc/NEWS @@ -18,6 +18,9 @@ Core and Builtins Library ------- +- Issue #19343: Expose FreeBSD-specific APIs in resource module. Original

--- a/Modules/resource.c +++ b/Modules/resource.c @@ -424,6 +424,20 @@ PyInit_resource(void) PyModule_AddIntMacro(m, RUSAGE_THREAD); #endif +/* FreeBSD specific */ + +#ifdef RLIMIT_SWAP

+#endif + +#ifdef RLIMIT_SBSIZE

+#endif + +#ifdef RLIMIT_NPTS

+#endif + #if defined(HAVE_LONG_LONG) if (sizeof(RLIM_INFINITY) > sizeof(long)) { v = PyLong_FromLongLong((PY_LONG_LONG) RLIM_INFINITY);