diff options
author | Donghee Na <donghee.na@python.org> | 2023-10-10 10:00:09 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-10 10:00:09 (GMT) |
commit | 0362cbf908aff2b87298f8a9422e7b368f890071 (patch) | |
tree | 7d5ae0e1f44801fe2102cb783938c60ef99b7ae4 /Python/clinic/sysmodule.c.h | |
parent | 5aa62a8de15212577a13966710b3aede46e93824 (diff) | |
download | cpython-0362cbf908aff2b87298f8a9422e7b368f890071.zip cpython-0362cbf908aff2b87298f8a9422e7b368f890071.tar.gz cpython-0362cbf908aff2b87298f8a9422e7b368f890071.tar.bz2 |
gh-109595: Add -Xcpu_count=<n> cmdline for container users (#109667)
---------
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Gregory P. Smith [Google LLC] <greg@krypto.org>
Diffstat (limited to 'Python/clinic/sysmodule.c.h')
-rw-r--r-- | Python/clinic/sysmodule.c.h | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/Python/clinic/sysmodule.c.h b/Python/clinic/sysmodule.c.h index 30691c3..06105e2 100644 --- a/Python/clinic/sysmodule.c.h +++ b/Python/clinic/sysmodule.c.h @@ -1380,6 +1380,34 @@ exit: return return_value; } +PyDoc_STRVAR(sys__get_cpu_count_config__doc__, +"_get_cpu_count_config($module, /)\n" +"--\n" +"\n" +"Private function for getting PyConfig.cpu_count"); + +#define SYS__GET_CPU_COUNT_CONFIG_METHODDEF \ + {"_get_cpu_count_config", (PyCFunction)sys__get_cpu_count_config, METH_NOARGS, sys__get_cpu_count_config__doc__}, + +static int +sys__get_cpu_count_config_impl(PyObject *module); + +static PyObject * +sys__get_cpu_count_config(PyObject *module, PyObject *Py_UNUSED(ignored)) +{ + PyObject *return_value = NULL; + int _return_value; + + _return_value = sys__get_cpu_count_config_impl(module); + if ((_return_value == -1) && PyErr_Occurred()) { + goto exit; + } + return_value = PyLong_FromLong((long)_return_value); + +exit: + return return_value; +} + #ifndef SYS_GETWINDOWSVERSION_METHODDEF #define SYS_GETWINDOWSVERSION_METHODDEF #endif /* !defined(SYS_GETWINDOWSVERSION_METHODDEF) */ @@ -1423,4 +1451,4 @@ exit: #ifndef SYS_GETANDROIDAPILEVEL_METHODDEF #define SYS_GETANDROIDAPILEVEL_METHODDEF #endif /* !defined(SYS_GETANDROIDAPILEVEL_METHODDEF) */ -/*[clinic end generated code: output=549bb1f92a15f916 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=3a7d3fbbcb281c22 input=a9049054013a1b77]*/ |