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
VM: restore >4k secondary cache functionality
[minix.git]
/
lib
/
libminlib
/
getnprocnr.c
blob
85521cb2785cd64e5209c563d5109ed45ac3acf5
1
#include <lib.h>
2
#include <unistd.h>
3
4
5
int
getnprocnr
(
pid_t pid
)
6
{
7
message m
;
8
int
t
=
GETPROCNR
;
9
m
.
m1_i1
=
pid
;
/* pass pid >=0 to search for */
10
m
.
m1_i2
=
0
;
/* don't pass name to search for */
11
if
(
_syscall
(
PM_PROC_NR
,
t
, &
m
) <
0
)
return
(-
1
);
12
return
(
m
.
m1_i1
);
/* return search result */
13
}
14