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

"Ingo Weinhold" <bonefish-CFLBMwTPW48UNGrzBIF7/[email protected]>
Newsgroups gmane.os.openbeos.storage
Message-ID <3617020251-BeMail@graete>
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-/[email protected]
From: Siarzhuk Zharski <[email protected]>
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-/[email protected]
http://www.bug-br.org.br/mailman/listinfo/bedevtalk
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.