ftok(3) Library Functions Manual ftok(3) ftok - System V IPC C (libc, -lc) #include key_t ftok(const char *path, int proj_id); The ftok() function uses the identity of the file named by the given path (which must refer to an existing, accessible file) and the least significant 8 bits of proj_id (which must be nonzero) to generate a key_t type System V IPC key, suitable for use with msgget(2), semget(2), or shmget(2). , proj_id. , ( ) . key_t. -1, errno stat(2). attributes(7). +----------------------------+----------------------------------------------------------+--------------------------+ | | | | +----------------------------+----------------------------------------------------------+--------------------------+ |ftok() | | MT-Safe | +----------------------------+----------------------------------------------------------+--------------------------+ POSIX.1-2008. POSIX.1-2001. : key_t ftok(char *path, char proj_id); proj_id int, , , - 8 . , proj_id ASCII, , proj_id . , , key_t . proj_id 16 inode 8 32- . , /dev/hda1 /dev/sda1. See semget(2). msgget(2), semget(2), shmget(2), stat(2), sysvipc(7) () Azamat Hackimov , Dmitry Bolkhovskikh , Yuri Kozlov , Kirill Rekhov ; GNU (GNU General Public License - GPL, 3 ) , - . - , , () () () <>. Linux 6.15 17 2025 . ftok(3)