Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions treeshr/RemoteAccess.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <mdsplus/mdsconfig.h>
#include <mdsplus/mdsplus.h>
#ifdef _WIN32
#include <winsock2.h>
#include <windows.h>
Expand All @@ -39,11 +40,23 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// # define flock lx_flock
// # include <linux/fcntl.h>
// # undef flock

#ifndef F_OFD_SETLK
#ifdef _MACOSX
// Open File Descriptor (OFD) locks have existed as a private / undocumented
// feature in MacOS releases since 2015. For more details, refer to the
// comments at the end of Issue #2599 and the earlier PRs #2163 and #2198.
#define F_OFD_GETLK 92
#define F_OFD_SETLK 90
#define F_OFD_SETLKW 91
#else
// The usual defines for Linux
#define F_OFD_GETLK 36
#define F_OFD_SETLK 37
#define F_OFD_SETLKW 38
#endif
#endif

#endif
#include <ctype.h>
#include <errno.h>
Expand Down