summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2016-11-13 13:21:47 +0100
committerGiampaolo Rodola <g.rodola@gmail.com>2016-11-13 13:21:47 +0100
commita26d8960d8043a950b5649595411fdaa245de13a (patch)
tree1dfab519b32b9ceeddba403b12f5c550361930a7
parentb79bedb235c15cdf1eb00937dbf1f87fec1dbd1c (diff)
downloadpsutil-a26d8960d8043a950b5649595411fdaa245de13a.tar.gz
OSX: fix compilation warning
-rw-r--r--IDEAS22
-rw-r--r--psutil/_psutil_posix.c10
2 files changed, 32 insertions, 0 deletions
diff --git a/IDEAS b/IDEAS
index a80c9dc0..74147e2e 100644
--- a/IDEAS
+++ b/IDEAS
@@ -14,9 +14,19 @@ PLATFORMS
- DragonFlyBSD
- HP-UX
+
+APIS
+====
+
+- cpu_info() (#550)
+
+
FEATURES
========
+- #550: CPU info (frequency, architecture, threads per core, cores per socket,
+ sockets, ...)
+
- #772: extended net_io_counters() metrics.
- #900: wheels for OSX and Linux.
@@ -146,6 +156,18 @@ FEATURES
- Have psutil.Process().cpu_affinity([]) be an alias for "all CPUs"?
+BUGFIXES
+========
+
+- #600: windows / open_files(): support network file handles.
+
+
+REJECTED
+========
+
+- #550: threads per core
+
+
RESOURCES
=========
diff --git a/psutil/_psutil_posix.c b/psutil/_psutil_posix.c
index 698b4b1a..2d9630ac 100644
--- a/psutil/_psutil_posix.c
+++ b/psutil/_psutil_posix.c
@@ -49,7 +49,12 @@ psutil_posix_getpriority(PyObject *self, PyObject *args) {
if (! PyArg_ParseTuple(args, "l", &pid))
return NULL;
+
+#if defined(__APPLE__)
+ priority = getpriority(PRIO_PROCESS, (id_t)pid);
+#else
priority = getpriority(PRIO_PROCESS, pid);
+#endif
if (errno != 0)
return PyErr_SetFromErrno(PyExc_OSError);
return Py_BuildValue("i", priority);
@@ -67,7 +72,12 @@ psutil_posix_setpriority(PyObject *self, PyObject *args) {
if (! PyArg_ParseTuple(args, "li", &pid, &priority))
return NULL;
+
+#if defined(__APPLE__)
+ retval = setpriority(PRIO_PROCESS, (id_t)pid, priority);
+#else
retval = setpriority(PRIO_PROCESS, pid, priority);
+#endif
if (retval == -1)
return PyErr_SetFromErrno(PyExc_OSError);
Py_RETURN_NONE;