Skip to content

Commit

Permalink
OSX: fix compilation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
giampaolo committed Nov 13, 2016
1 parent b79bedb commit a26d896
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
22 changes: 22 additions & 0 deletions IDEAS
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
=========

Expand Down
10 changes: 10 additions & 0 deletions psutil/_psutil_posix.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
Expand Down

0 comments on commit a26d896

Please sign in to comment.