3 ms·
So it turns out only one sentence near the end really matters: "I guess lockfiles are the answer after all." Yup. Don't use the locking APIs. Just use lockf
by kelnos 16y ago
So it turns out only one sentence near the end really matters:
"I guess lockfiles are the answer after all."
Yup. Don't use the locking APIs. Just use lockfiles be done with it.
I'd actually go a step further and suggest only using lock directories. Using lockfiles assumes O_CREAT|O_EXCL works properly everywhere (which is probably a safe assumption, but...). mkdir() will return EEXIST if you fail to acquire the 'lock'.