I have an existing code in system that uses ftok() to generate key based on the file name and a zero passed to it. The code was working fine on 32 bit but starts complaining randomly when moved to 64 bits. On researching more , I found that this is mostly because of the lower signicant bits are zero and shmopen() could be a better alternative. Let me know does shmopen() is safe from key collisions? Are there any better way to avoid key collisions?
key = ftok(filename,0);