More annoying questions...

How does one use "AFP-style mandatory file locking" in macOS (10.9...current)?

I'm trying to implement file locking/coordination across various filesystems and servers.

The man page for getattrlist() includes the following filesystem capability test:

VOL_CAP_INT_MANLOCK  If this bit is set, the volume format implementation
                     supports AFP-style mandatory byte range locks
                     via ioctl(2).

AFPFS (a.k.a. AppleShare) volumes, particularly those on AirPort Extreme / Time Capsule devices, return 1 for this capability. These volumes do not support flock() or fcntl(F_SETLK) style advisory locking.

I looked at the man page for ioctl(2) and it contains no real information. It says the commands for ioctl(2) are documented in <sys/ioctl.h>.

So I had a look at <sys/ioctl.h> and found very little there; it's basically an umbrella header for several other headers. So I went through them one at a time: <sys/ttycom.h>, <sys/ioccom.h>, <sys/filio.h> (the one I would have assumed it would be in), and <sys/sockio.h>. I could found no mention of any kind of file or byte range locking commands defined.

So, is it possible to lock files/ranges on an AFPFS volume using ioctl(2), and if so where are these commands defined?


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Filesystem-dev mailing list      (Filesystem-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/filesystem-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to