Sign in
fuchsia
/
fuchsia
/
refs/heads/releases/dogfood
/
.
/
zircon
/
third_party
/
ulib
/
musl
/
src
/
ipc
/
ftok.c
blob: 548a43e123d899dcc944dee39840288733e7a7c9 [
file
] [
log
] [
blame
] [
edit
]
#include
<sys/ipc.h>
#include
<sys/stat.h>
key_t
ftok
(
const
char
*
path
,
int
id
)
{
struct
stat st
;
if
(
stat
(
path
,
&
st
)
<
0
)
return
-
1
;
return
((
st
.
st_ino
&
0xffff
)
|
((
st
.
st_dev
&
0xff
)
<<
16
)
|
((
id
&
0xff
)
<<
24
));
}