Maybe I'm missing something obvious, but what's wrong with the following locking mechanism? It's the one I've always used and never (to my knowledge) had any races: while((lfd = creat(LOCKFILE, 0)) < 0) sleep(10); Isn't creat() an atomic operation? --Pavel Curtis (Pavel.Cornell at Udel)