Talk About Network

Google





Mac > Mac Programmer Help > fcntl, F_WRLCK,...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 3716 of 3889
Post > Topic >>

fcntl, F_WRLCK, ENOSUP ??

by eric <eselk@[EMAIL PROTECTED] > Apr 21, 2008 at 05:12 PM

I have some simple code that looks something like this:

int fh = open("/Volumes/WORKGROUPNAME;PCNAME/mactest/test.dat",O_RDWR|
O_DENYNONE);

struct flock f;
f.l_start = 0;
f.l_len = 0;
f.l_type = F_WRLCK;
f.l_whence = SEEK_SET;

int r = fcntl(fh,F_SETLK,&f);

If the file in the open() call is a local file, everything works
fine.  If the file is located on a Windows XP file share, fcntl()
returns ENOSUP.

Is this type of file locking not sup****ted when you have a Mac client
accessing a Windows XP file share?  If not, is there another way to
lock one byte in a file that will work in a mixed environment?  I have
Windows clients that use this byte locking to handle concurrent file i/
o issues.  Locking an entire file really isn't an option, because this
is "record locking" that I'm doing, so I really need to be able to
lock just one byte.

Watching the network packets, I see the "NT File Create" SMB packet,
and the return, saying that the file was opened without any problems.
But then I never see any type of lock request, so the Mac client must
be deciding that the opperation isn't sup****ted before it even
attempts to ask the file server to lock.
 




 1 Posts in Topic:
fcntl, F_WRLCK, ENOSUP ??
eric <eselk@[EMAIL PRO  2008-04-21 17:12:52 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
localhost-V2008-12-19 Wed Jan 7 20:02:28 PST 2009.