summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--psutil/_psutil_osx.c12
-rw-r--r--psutil/arch/osx/process_info.c4
-rw-r--r--psutil/arch/osx/process_info.h3
3 files changed, 10 insertions, 9 deletions
diff --git a/psutil/_psutil_osx.c b/psutil/_psutil_osx.c
index 7a0f73b0..948dec54 100644
--- a/psutil/_psutil_osx.c
+++ b/psutil/_psutil_osx.c
@@ -144,7 +144,7 @@ psutil_proc_cwd(PyObject *self, PyObject *args) {
if (! PyArg_ParseTuple(args, "l", &pid))
return NULL;
- if (! psutil_proc_pidinfo(pid, PROC_PIDVNODEPATHINFO, &pathinfo,
+ if (! psutil_proc_pidinfo(pid, PROC_PIDVNODEPATHINFO, 0, &pathinfo,
sizeof(pathinfo)))
{
return NULL;
@@ -474,7 +474,7 @@ psutil_proc_cpu_times(PyObject *self, PyObject *args) {
if (! PyArg_ParseTuple(args, "l", &pid))
return NULL;
- if (! psutil_proc_pidinfo(pid, PROC_PIDTASKINFO, &pti, sizeof(pti)))
+ if (! psutil_proc_pidinfo(pid, PROC_PIDTASKINFO, 0, &pti, sizeof(pti)))
return NULL;
return Py_BuildValue("(dd)",
(float)pti.pti_total_user / 1000000000.0,
@@ -508,13 +508,13 @@ psutil_proc_memory_info(PyObject *self, PyObject *args) {
if (! PyArg_ParseTuple(args, "l", &pid))
return NULL;
- if (! psutil_proc_pidinfo(pid, PROC_PIDTASKINFO, &pti, sizeof(pti)))
+ if (! psutil_proc_pidinfo(pid, PROC_PIDTASKINFO, 0, &pti, sizeof(pti)))
return NULL;
// Note: determining other memory stats on OSX is a mess:
// http://www.opensource.apple.com/source/top/top-67/libtop.c?txt
// I just give up...
// struct proc_regioninfo pri;
- // psutil_proc_pidinfo(pid, PROC_PIDREGIONINFO, &pri, sizeof(pri))
+ // psutil_proc_pidinfo(pid, PROC_PIDREGIONINFO, 0, &pri, sizeof(pri))
return Py_BuildValue(
"(KKkk)",
pti.pti_resident_size, // resident memory size (rss)
@@ -656,7 +656,7 @@ psutil_proc_num_threads(PyObject *self, PyObject *args) {
if (! PyArg_ParseTuple(args, "l", &pid))
return NULL;
- if (! psutil_proc_pidinfo(pid, PROC_PIDTASKINFO, &pti, sizeof(pti)))
+ if (! psutil_proc_pidinfo(pid, PROC_PIDTASKINFO, 0, &pti, sizeof(pti)))
return NULL;
return Py_BuildValue("k", pti.pti_threadnum);
}
@@ -672,7 +672,7 @@ psutil_proc_num_ctx_switches(PyObject *self, PyObject *args) {
if (! PyArg_ParseTuple(args, "l", &pid))
return NULL;
- if (! psutil_proc_pidinfo(pid, PROC_PIDTASKINFO, &pti, sizeof(pti)))
+ if (! psutil_proc_pidinfo(pid, PROC_PIDTASKINFO, 0, &pti, sizeof(pti)))
return NULL;
// unvoluntary value seems not to be available;
// pti.pti_csw probably refers to the sum of the two (getrusage()
diff --git a/psutil/arch/osx/process_info.c b/psutil/arch/osx/process_info.c
index 16de2b8f..f85fcc08 100644
--- a/psutil/arch/osx/process_info.c
+++ b/psutil/arch/osx/process_info.c
@@ -356,8 +356,8 @@ psutil_get_kinfo_proc(pid_t pid, struct kinfo_proc *kp) {
* A thin wrapper around proc_pidinfo()
*/
int
-psutil_proc_pidinfo(long pid, int flavor, void *pti, int size) {
- int ret = proc_pidinfo((int)pid, flavor, 0, pti, size);
+psutil_proc_pidinfo(long pid, int flavor, uint64_t arg, void *pti, int size) {
+ int ret = proc_pidinfo((int)pid, flavor, arg, pti, size);
if (ret == 0) {
if (! psutil_pid_exists(pid)) {
NoSuchProcess();
diff --git a/psutil/arch/osx/process_info.h b/psutil/arch/osx/process_info.h
index ec6e0f75..82fa9ed7 100644
--- a/psutil/arch/osx/process_info.h
+++ b/psutil/arch/osx/process_info.h
@@ -11,6 +11,7 @@ typedef struct kinfo_proc kinfo_proc;
int psutil_get_argmax(void);
int psutil_get_kinfo_proc(pid_t pid, struct kinfo_proc *kp);
int psutil_get_proc_list(kinfo_proc **procList, size_t *procCount);
-int psutil_proc_pidinfo(long pid, int flavor, void *pti, int size);
+int psutil_proc_pidinfo(
+ long pid, int flavor, uint64_t arg, void *pti, int size);
PyObject* psutil_get_cmdline(long pid);
PyObject* psutil_get_environ(long pid);