summaryrefslogtreecommitdiff
path: root/Modules/resource.c
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2013-12-08 14:35:55 +0100
committerChristian Heimes <christian@cheimes.de>2013-12-08 14:35:55 +0100
commit5bb414d176b5c99d9f2500738fe77c47ea938763 (patch)
tree84b7bfa89c46eb75e08ddb25ba174ac2b769271e /Modules/resource.c
parentead8d0858b326ec8d902dc597aa3da23e4c5a82b (diff)
downloadcpython-git-5bb414d176b5c99d9f2500738fe77c47ea938763.tar.gz
Issue #19343: Expose FreeBSD-specific APIs in resource module. Original patch by Koobs.
Diffstat (limited to 'Modules/resource.c')
-rw-r--r--Modules/resource.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/Modules/resource.c b/Modules/resource.c
index c12ce341fe..3a1cf094c7 100644
--- 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
+ PyModule_AddIntMacro(m, RLIMIT_SWAP);
+#endif
+
+#ifdef RLIMIT_SBSIZE
+ PyModule_AddIntMacro(m, RLIMIT_SBSIZE);
+#endif
+
+#ifdef RLIMIT_NPTS
+ PyModule_AddIntMacro(m, RLIMIT_NPTS);
+#endif
+
#if defined(HAVE_LONG_LONG)
if (sizeof(RLIM_INFINITY) > sizeof(long)) {
v = PyLong_FromLongLong((PY_LONG_LONG) RLIM_INFINITY);