Beco <[email protected]> writes:

> After implementing the score (using SGID), I have a race condition in my
> game.

> The comparisson is between the just scored point with the last point
> in the top-10.

> readscore_file2memory();
> If(pt>top[9])
> {
>   printf("Congrats... and stuff\n");
>   reorderscore_memory();
>   savescore_memory2file();
> }

> What would be the standard way to lock the scorefile?

fcntl(fd, F_SETLK).  See fcntl(2).

-- 
Russ Allbery ([email protected])               <http://www.eyrie.org/~eagle/>


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]
Archive: http://lists.debian.org/[email protected]

Reply via email to