cpython: aec95b369e60 (original) (raw)

Mercurial > cpython

changeset 86565:aec95b369e60

Issue #19324: Expose Linux-specific constants in resource module [#19324]

Christian Heimes christian@cheimes.de
date Tue, 22 Oct 2013 11:09:27 +0200
parents 9b2d5d186144
children 796c21e27a92
files Doc/library/resource.rst Lib/test/test_resource.py Misc/NEWS Modules/resource.c
diffstat 4 files changed, 80 insertions(+), 0 deletions(-)[+] [-] Doc/library/resource.rst 46 Lib/test/test_resource.py 10 Misc/NEWS 2 Modules/resource.c 22

line wrap: on

line diff

--- a/Doc/library/resource.rst +++ b/Doc/library/resource.rst @@ -151,6 +151,52 @@ platform. The maximum area (in bytes) of address space which may be taken by the process. +.. data:: RLIMIT_MSGQUEUE +

+ +.. data:: RLIMIT_NICE +

+ +.. data:: RLIMIT_RTPRIO +

+ +.. data:: RLIMIT_RTTIME +

+ +.. data:: RLIMIT_SIGPENDING +

+ Resource Usage --------------

--- a/Lib/test/test_resource.py +++ b/Lib/test/test_resource.py @@ -1,3 +1,4 @@ +import sys import unittest from test import support import time @@ -129,6 +130,15 @@ class ResourceTest(unittest.TestCase): self.assertIsInstance(pagesize, int) self.assertGreaterEqual(pagesize, 0)

+ + def test_main(verbose=None): support.run_unittest(ResourceTest)

--- a/Misc/NEWS +++ b/Misc/NEWS @@ -19,6 +19,8 @@ Core and Builtins Library ------- +- Issue #19324: Expose Linux-specific constants in resource module. +

--- a/Modules/resource.c +++ b/Modules/resource.c @@ -326,6 +326,28 @@ PyInit_resource(void) PyModule_AddIntMacro(m, RLIMIT_SBSIZE); #endif +/* Linux specific */ +#ifdef RLIMIT_MSGQUEUE

+#endif + +#ifdef RLIMIT_NICE

+#endif + +#ifdef RLIMIT_RTPRIO

+#endif + +#ifdef RLIMIT_RTTIME

+#endif + +#ifdef RLIMIT_SIGPENDING

+#endif + +/* target */ #ifdef RUSAGE_SELF PyModule_AddIntMacro(m, RUSAGE_SELF); #endif