Commit 29ac3cb7 authored by Neil Schemenauer's avatar Neil Schemenauer

Expose RLIM_INFINITY constant. Closes SF patch 489066.

parent 153cc0fd
...@@ -160,7 +160,7 @@ resource_methods[] = { ...@@ -160,7 +160,7 @@ resource_methods[] = {
DL_EXPORT(void) DL_EXPORT(void)
initresource(void) initresource(void)
{ {
PyObject *m; PyObject *m, *v;
/* Create the module and add the functions */ /* Create the module and add the functions */
m = Py_InitModule("resource", resource_methods); m = Py_InitModule("resource", resource_methods);
...@@ -233,4 +233,16 @@ initresource(void) ...@@ -233,4 +233,16 @@ initresource(void)
#ifdef RUSAGE_BOTH #ifdef RUSAGE_BOTH
PyModule_AddIntConstant(m, "RUSAGE_BOTH", RUSAGE_BOTH); PyModule_AddIntConstant(m, "RUSAGE_BOTH", RUSAGE_BOTH);
#endif #endif
#if defined(HAVE_LONG_LONG)
if (sizeof(RLIM_INFINITY) > sizeof(long)) {
v = PyLong_FromLongLong((LONG_LONG) RLIM_INFINITY);
} else
#endif
{
v = PyInt_FromLong((long) RLIM_INFINITY);
}
if (v) {
PyModule_AddObject(m, "RLIM_INFINITY", v);
}
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment