mirror of
https://github.com/python/cpython.git
synced 2025-12-15 21:44:50 +00:00
Expose RLIM_INFINITY constant. Closes SF patch 489066.
This commit is contained in:
parent
153cc0fddc
commit
29ac3cb7ed
1 changed files with 13 additions and 1 deletions
|
|
@ -160,7 +160,7 @@ resource_methods[] = {
|
|||
DL_EXPORT(void)
|
||||
initresource(void)
|
||||
{
|
||||
PyObject *m;
|
||||
PyObject *m, *v;
|
||||
|
||||
/* Create the module and add the functions */
|
||||
m = Py_InitModule("resource", resource_methods);
|
||||
|
|
@ -233,4 +233,16 @@ initresource(void)
|
|||
#ifdef RUSAGE_BOTH
|
||||
PyModule_AddIntConstant(m, "RUSAGE_BOTH", RUSAGE_BOTH);
|
||||
#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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue