FCNTL on Solaris
David Collier-Brown
davecb at canada.sun.com
Mon Apr 22 12:23:01 GMT 2002
David Collier-Brown wrote:
> tdb_trylock(), which does an fcntl(tdb->fd,F_SETLK, &fl)
Make that:
tdb_trylock(stuff...) {
if (fcntl(tdb->fd,F_SETLK, &fl) == -1) {
/* The lock is in use */
return ITS_LOCKED_ALREADY_GO_AWAY;
}
else {
return OK_WE_HAVE_THE_LOCK;
}
}
I'm making logic errors all over the place: could
someone check that's a valid trylock algorithm
using fcntl?
--dave
--
David Collier-Brown, | Always do right. This will gratify
Performance & Engineering | some people and astonish the rest.
Americas Customer Engineering, | -- Mark Twain
(905) 415-2849 | davecb at canada.sun.com
More information about the samba-technical
mailing list