2005-05-20 11:37:43 +02:00
|
|
|
#include <lib.h>
|
|
|
|
#define getprocnr _getprocnr
|
|
|
|
#include <unistd.h>
|
|
|
|
|
|
|
|
|
2005-08-02 17:32:12 +02:00
|
|
|
PUBLIC int getprocnr()
|
2005-05-20 11:37:43 +02:00
|
|
|
{
|
|
|
|
message m;
|
2005-10-12 17:10:14 +02:00
|
|
|
m.m1_i1 = -1; /* don't pass pid to search for */
|
|
|
|
m.m1_i2 = 0; /* don't pass name to search for */
|
|
|
|
if (_syscall(PM_PROC_NR, GETPROCNR, &m) < 0) return(-1);
|
|
|
|
return(m.m1_i1); /* return own process number */
|
2005-05-20 11:37:43 +02:00
|
|
|
}
|
|
|
|
|