[openbeosstorage] [bedevtalk]fcntl(), BNode::Lock() and _klock_node_() ... (fwd)

Hi guys,

seems someone did a bit of research for us. :-)
I suspect, it's `extern "C" int =5Fklock=5Fnode=5F(int fhandle);' though.

CU, Ingo

------ Forwarded Message: ------
To: bedevtalk@xxxxxxxxxxxxx
From: Siarzhuk Zharski <zharik@xxxxxx>
Subject: [bedevtalk]fcntl(), BNode::Lock() and =5Fklock=5Fnode=5F() ...
Date: Tue, 25 Feb 2003 08:58:38 +0100

Hello World!

Can anybody clearify situation with file locking under BeOS=3F All I have 
is a POSIX file handle from open(...) call. Are there any possibilities 
to assign BNode object to this handle=3F  I just need to block any access 
to this file. So, something like BNode::Lock() will be enough for me. I 
have seen in BNode class definition that there is a set=5Ffd(..) call in 
private part. I have used this function to assign my file handle to 
BNode object and called it's Lock() function. Such locking works but 
it's a not right way, IMHO.

By the way, during my debug session I have found, that BNode::Lock() 
just calls some undocumented =5Fklock=5Fnode=5F function. I have tried to 
define it as :

extern "C" status=5Ft =5Fklock=5Fnode=5F(int fhandle);

  and use it for loking of my file handles. It works. After setting 
lock 
in this manner other processes will fail accessing this file with 
B=5FBUSY 
error ... How safe is it=3F Has anybody heard about that functions=3F

MfG, SZ.

=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F
bedevtalk mailing list
bedevtalk@xxxxxxxxxxxxx
http://www.bug-br.org.br/mailman/listinfo/bedevtalk



Other related posts: