minix/lib/other/_getnpid.c
2009-09-21 14:44:00 +00:00

11 lines
289 B
C

#include <lib.h>
#define getnpid _getnpid
#include <unistd.h>
PUBLIC pid_t getnpid(int proc_nr)
{
message m;
m.m1_i1 = proc_nr; /* search pid for this process */
if (_syscall(MM, MINIX_GETPID, &m) < 0) return ( (pid_t) -1);
return( (pid_t) m.m2_i2); /* return search result */
}