2005-06-02 14:43:21 +02:00
|
|
|
#include <lib.h>
|
2006-03-25 05:49:04 +01:00
|
|
|
#define _pm_findproc __pm_findproc
|
2005-06-02 14:43:21 +02:00
|
|
|
#include <unistd.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
2006-03-25 05:49:04 +01:00
|
|
|
PUBLIC int _pm_findproc(proc_name, proc_nr)
|
2005-06-02 14:43:21 +02:00
|
|
|
char *proc_name; /* name of process to search for */
|
|
|
|
int *proc_nr; /* return process number here */
|
|
|
|
{
|
|
|
|
message m;
|
|
|
|
|
|
|
|
m.m1_p1 = proc_name;
|
2005-08-02 17:32:12 +02:00
|
|
|
m.m1_i1 = -1; /* search by name */
|
|
|
|
m.m1_i2 = strlen(proc_name) + 1;
|
2005-06-02 14:43:21 +02:00
|
|
|
if (_syscall(MM, GETPROCNR, &m) < 0) return(-1);
|
|
|
|
*proc_nr = m.m1_i1;
|
|
|
|
return(0);
|
|
|
|
}
|
|
|
|
|