home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Serving the Web
/
ServingTheWeb1995.disc1of1.iso
/
linux
/
slacksrce
/
d
/
libc
/
libc-4.6
/
libc-4
/
libc-linux
/
misc
/
ftok.c
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
C/C++ Source or Header
|
1994-06-29
|
362 b
|
20 lines
#include <sys/stat.h>
#include <sys/ipc.h>
key_t
ftok (char *path, char id)
{
struct stat buf;
key_t key;
if (__stat (path, &buf)) {
return (key_t) -1;
}
#if 0
key = (buf.st_ino & 0xFFFF) | ((buf.st_uid & 0xFF) << 16) | (id << 24);
#else
key = (buf.st_ino & 0xFFFF) | ((buf.st_dev & 0xFF) << 16) | (id << 24);
#endif
return key;
}