I'm developing app under c that needs to comunicate via shared memory. I need to generate key, by some fields in my app, so I just converted them to int and call ftok, but it doesn't work and I dont know why.
Code that causes error:
int proj_id = 3001; // it's calculated by app, basicly it just convert a few fields into unique int for example 3001
key_t key;
if((key = ftok(".", proj_id)) < 0);
{
perror("ftok");
return -1;
}
output : ftok: Resource temporarily unavailable
But constantly i run into this issue. Do you have any idea why and how to solve it? Thanks in an advance! ;)