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.


|