summaryrefslogtreecommitdiff
path: root/psutil/_psutil_posix.c
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2018-06-29 16:37:47 +0200
committerGiampaolo Rodola <g.rodola@gmail.com>2018-06-29 16:37:47 +0200
commit1b09b5fff78f705dfb42458726ff9789c26f6f21 (patch)
treea97e3621cfc6160bca7a327c9f7f4d294a092c2f /psutil/_psutil_posix.c
parent05066d9744f0b981f612c71eecace817a2ba7a08 (diff)
downloadpsutil-1b09b5fff78f705dfb42458726ff9789c26f6f21.tar.gz
revert file renaming of macos files; get them back to 'osx' prefix
Diffstat (limited to 'psutil/_psutil_posix.c')
-rw-r--r--psutil/_psutil_posix.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/psutil/_psutil_posix.c b/psutil/_psutil_posix.c
index e9a8f2d9..c851abbc 100644
--- a/psutil/_psutil_posix.c
+++ b/psutil/_psutil_posix.c
@@ -28,7 +28,7 @@
#include <netdb.h>
#include <linux/types.h>
#include <linux/if_packet.h>
-#elif defined(PSUTIL_BSD) || defined(PSUTIL_MACOS)
+#elif defined(PSUTIL_BSD) || defined(PSUTIL_OSX)
#include <netdb.h>
#include <netinet/in.h>
#include <net/if_dl.h>
@@ -71,7 +71,7 @@ psutil_pid_exists(long pid) {
#endif
}
-#if defined(PSUTIL_MACOS)
+#if defined(PSUTIL_OSX)
ret = kill((pid_t)pid , 0);
#else
ret = kill(pid , 0);
@@ -143,7 +143,7 @@ psutil_posix_getpriority(PyObject *self, PyObject *args) {
if (! PyArg_ParseTuple(args, "l", &pid))
return NULL;
-#ifdef PSUTIL_MACOS
+#ifdef PSUTIL_OSX
priority = getpriority(PRIO_PROCESS, (id_t)pid);
#else
priority = getpriority(PRIO_PROCESS, pid);
@@ -166,7 +166,7 @@ psutil_posix_setpriority(PyObject *self, PyObject *args) {
if (! PyArg_ParseTuple(args, "li", &pid, &priority))
return NULL;
-#ifdef PSUTIL_MACOS
+#ifdef PSUTIL_OSX
retval = setpriority(PRIO_PROCESS, (id_t)pid, priority);
#else
retval = setpriority(PRIO_PROCESS, pid, priority);
@@ -221,7 +221,7 @@ psutil_convert_ipaddr(struct sockaddr *addr, int family) {
len = lladdr->sll_halen;
data = (const char *)lladdr->sll_addr;
}
-#elif defined(PSUTIL_BSD) || defined(PSUTIL_MACOS)
+#elif defined(PSUTIL_BSD) || defined(PSUTIL_OSX)
else if (addr->sa_family == AF_LINK) {
// Note: prior to Python 3.4 socket module does not expose
// AF_LINK so we'll do.
@@ -433,7 +433,7 @@ error:
/*
* net_if_stats() macOS/BSD implementation.
*/
-#if defined(PSUTIL_BSD) || defined(PSUTIL_MACOS)
+#if defined(PSUTIL_BSD) || defined(PSUTIL_OSX)
int psutil_get_nic_speed(int ifm_active) {
// Determine NIC speed. Taken from:
@@ -638,7 +638,7 @@ PsutilMethods[] = {
"Retrieve NIC MTU"},
{"net_if_flags", psutil_net_if_flags, METH_VARARGS,
"Retrieve NIC flags"},
-#if defined(PSUTIL_BSD) || defined(PSUTIL_MACOS)
+#if defined(PSUTIL_BSD) || defined(PSUTIL_OSX)
{"net_if_duplex_speed", psutil_net_if_duplex_speed, METH_VARARGS,
"Return NIC stats."},
#endif
@@ -698,7 +698,7 @@ void init_psutil_posix(void)
PyObject *module = Py_InitModule("_psutil_posix", PsutilMethods);
#endif
-#if defined(PSUTIL_BSD) || defined(PSUTIL_MACOS) || defined(PSUTIL_SUNOS) || defined(PSUTIL_AIX)
+#if defined(PSUTIL_BSD) || defined(PSUTIL_OSX) || defined(PSUTIL_SUNOS) || defined(PSUTIL_AIX)
PyModule_AddIntConstant(module, "AF_LINK", AF_LINK);
#endif