minix/lib/libc/other/__pm_findproc.c
2010-06-08 13:58:01 +00:00

19 lines
450 B
C

#include <lib.h>
#define _pm_findproc __pm_findproc
#include <unistd.h>
#include <string.h>
PUBLIC int _pm_findproc(proc_name, proc_nr)
char *proc_name; /* name of process to search for */
int *proc_nr; /* return process number here */
{
message m;
m.m1_p1 = proc_name;
m.m1_i1 = -1; /* search by name */
m.m1_i2 = strlen(proc_name) + 1;
if (_syscall(PM_PROC_NR, GETPROCNR, &m) < 0) return(-1);
*proc_nr = m.m1_i1;
return(0);
}