From: Renaud L. <Ren...@ke...> - 2008-02-27 08:34:14
|
Le mardi 26 février 2008, Mike Frysinger a écrit : > how about just calling ipcgetkey() for every unique key you need ? Hum, no, I can't. With the current ipcgetkey() code, 2 calls to this function from a given process can return the same value ! It uses the ftok function to generate the key. The fisrt argument passed to ftok is the current pwd (so identical on each call). The second argument is a random()%26. If I am unlucky, this random()%26 can return the same value twice and then lead to the generation of the same key... That's why I need to create a new file for each key I need. R. -- Renaud Lottiaux Kerlabs Bâtiment Germanium 80, avenue des buttes de Coësmes 35700 Rennes - France Phone : (+33|0)6 80 89 19 34 Fax : (+33|0)2 99 84 71 71 Email : Ren...@ke... Web : http://www.kerlabs.com/ |