Skip to content
This repository has been archived by the owner on Jun 22, 2024. It is now read-only.

Commit

Permalink
NetBSD: use _Py_PARSE_PID instead of long
Browse files Browse the repository at this point in the history
Signed-off-by: Giampaolo Rodola <[email protected]>
  • Loading branch information
giampaolo committed Dec 20, 2023
1 parent cb3ab37 commit 5003480
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions psutil/arch/netbsd/proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ psutil_proc_cwd(PyObject *self, PyObject *args) {
char path[MAXPATHLEN];
size_t pathlen = sizeof path;

if (! PyArg_ParseTuple(args, "l", &pid))
if (! PyArg_ParseTuple(args, _Py_PARSE_PID, &pid))
return NULL;

#ifdef KERN_PROC_CWD
Expand All @@ -116,7 +116,7 @@ psutil_proc_cwd(PyObject *self, PyObject *args) {
free(buf);
if (len == -1) {
if (errno == ENOENT)
NoSuchProcess("sysctl -> ENOENT");
NoSuchProcess("readlink -> ENOENT");
else
PyErr_SetFromErrno(PyExc_OSError);
return NULL;
Expand All @@ -143,7 +143,7 @@ psutil_proc_exe(PyObject *self, PyObject *args) {
int ret;
size_t size;
if (! PyArg_ParseTuple(args, "l", &pid))
if (! PyArg_ParseTuple(args, _Py_PARSE_PID, &pid))
return NULL;
if (pid == 0) {
// else returns ENOENT
Expand Down Expand Up @@ -190,7 +190,7 @@ psutil_proc_num_threads(PyObject *self, PyObject *args) {
// Return number of threads used by process as a Python integer.
long pid;
kinfo_proc kp;
if (! PyArg_ParseTuple(args, "l", &pid))
if (! PyArg_ParseTuple(args, _Py_PARSE_PID, &pid))
return NULL;
if (psutil_kinfo_proc(pid, &kp) == -1)
return NULL;
Expand All @@ -211,7 +211,7 @@ psutil_proc_threads(PyObject *self, PyObject *args) {

if (py_retlist == NULL)
return NULL;
if (! PyArg_ParseTuple(args, "l", &pid))
if (! PyArg_ParseTuple(args, _Py_PARSE_PID, &pid))
goto error;

mib[0] = CTL_KERN;
Expand Down Expand Up @@ -396,7 +396,7 @@ psutil_proc_num_fds(PyObject *self, PyObject *args) {

struct kinfo_file *freep;

if (! PyArg_ParseTuple(args, "l", &pid))
if (! PyArg_ParseTuple(args, _Py_PARSE_PID, &pid))
return NULL;

errno = 0;
Expand Down

0 comments on commit 5003480

Please sign in to comment.