OT: Current range locking API

I need to implement a range locking feature in my Cocoa application. Since it is not posible using native Xojo I need to perforrm direct OS calls.

While checking the Apple documentation I found that the old calls “PBLockRangeSync” etc. are deprecated since Mac OS X 10.4 and “FSLockRange” is deprecated since OS X 10.8.

An fsctl call works on an AFP volume but not on a local HFS disc.

Anyone here with a idea how to implement rang locking using a current API on HFS?