minix/lib/libsys/getprocnr.c
Lionel Sambuc a1c31f335c Message type for PM_GETPROCNR
Change-Id: I4fcd682f78255afc1fdc0160fb6f1a3d2fe05d2e
2014-07-28 17:05:34 +02:00

19 lines
313 B
C

#include "syslib.h"
#include <unistd.h>
#include <string.h>
int
getprocnr(pid_t pid, endpoint_t *proc_e)
{
message m;
int r;
memset(&m, 0, sizeof(m));
m.m_lsys_pm_getprocnr.pid = pid;
if ((r = _taskcall(PM_PROC_NR, PM_GETPROCNR, &m)) < 0)
return r;
*proc_e = m.m_pm_lsys_getprocnr.endpt;
return r;
}