Back to index

glibc  2.9
Functions
ftok.c File Reference
#include <sys/ipc.h>
#include <sys/stat.h>

Go to the source code of this file.

Functions

key_t ftok (char *pathname, int proj_id) const

Function Documentation

key_t ftok ( char *  pathname,
int  proj_id 
) const

Definition at line 24 of file ftok.c.

{
  struct stat64 st;
  key_t key;

  if (__xstat64 (_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;
}

Here is the call graph for this function: