2005-10-12 17:10:14 +02:00
|
|
|
#include <lib.h>
|
|
|
|
#define getnprocnr _getnprocnr
|
|
|
|
#include <unistd.h>
|
|
|
|
|
|
|
|
|
|
|
|
PUBLIC int getnprocnr(pid_t pid)
|
|
|
|
{
|
|
|
|
message m;
|
2008-11-19 13:26:10 +01:00
|
|
|
int t = GETPROCNR;
|
2005-10-12 17:10:14 +02:00
|
|
|
m.m1_i1 = pid; /* pass pid >=0 to search for */
|
|
|
|
m.m1_i2 = 0; /* don't pass name to search for */
|
2008-11-19 13:26:10 +01:00
|
|
|
if (_syscall(PM_PROC_NR, t, &m) < 0) return(-1);
|
2005-10-12 17:10:14 +02:00
|
|
|
return(m.m1_i1); /* return search result */
|
|
|
|
}
|
|
|
|
|