1234567891011121314151617181920212223242526272829303132333435363738 |
- #include <sys/ipc.h>
- #include <sys/stat.h>
- key_t
- ftok (pathname, proj_id)
- const char *pathname;
- int proj_id;
- {
- struct stat st;
- key_t key;
- if (__xstat (_STAT_VER, pathname, &st) < 0)
- return (key_t) -1;
- key = ((st.st_ino & 0xffff) | ((st.st_dev & 0xff) << 16)
- | ((proj_id & 0xff) << 24));
- return key;
- }
|