repo.or.cz
/
minix.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
kernel: scheduling fix for ARM
[minix.git]
/
lib
/
libminlib
/
getprocnr.c
blob
2f0d1e6fc36da6d33ccc29ab1fbf2da1140aae86
1
#include <lib.h>
2
#include <unistd.h>
3
4
5
int
getprocnr
()
6
{
7
message m
;
8
m
.
m1_i1
= -
1
;
/* don't pass pid to search for */
9
m
.
m1_i2
=
0
;
/* don't pass name to search for */
10
if
(
_syscall
(
PM_PROC_NR
,
GETPROCNR
, &
m
) <
0
)
return
(-
1
);
11
return
(
m
.
m1_i1
);
/* return own process number */
12
}
13