#if defined(WIN32) || defined(LOCK_FCNTL) || defined(LOCK_LOCKF)
/* Ok we've chosen one*/
#else 
/* Then default to trying to use a real flock, */
#define LOCK_FLOCK TRUE
#endif

#ifdef LOCK_FLOCK
#ifndef NO_FCNTL
#define DO_LOCK_DEFS 1
#endif
#endif

#if defined(LOCK_FCNTL) || defined(LOCK_LOCKF) || defined(DO_LOCK_DEFS)
#ifndef _FLOCK_EMULATE_INCLUDED
#define _FLOCK_EMULATE_INCLUDED

#include <fcntl.h>

/* These definitions are in <sys/file.h> on BSD 4.3 */

/*
 * Flock call.
 */
#ifndef LOCK_SH
#define LOCK_SH		1	/* shared lock */
#define LOCK_EX		2	/* exclusive lock */
#define LOCK_NB		4	/* don't block when locking */
#define LOCK_UN		8	/* unlock */
#endif

#endif /* _FLOCK_EMULATE_INCLUDED */
#endif /* LOCK_FCNTL OR LOCK_LOCKF */

#ifdef WIN32
#define LOCK_SH		1	/* shared lock */
#define LOCK_EX		2	/* exclusive lock */
#define LOCK_NB		4	/* don't block when locking */
#define LOCK_UN		8	/* unlock */

int flock(int fd, int operation);
#define LOCK_NT 1
#endif

#if defined(LOCK_NT) || defined(LOCK_FCNTL) || defined(LOCK_LOCKF)
/* Ok we've chosen one*/
#else 
/* Then default to trying to use a real flock, */
#define LOCK_FLOCK TRUE
#endif

char *myflock_style(void);
int myflock_set_fcntl(int x);
int myflock_fcntl(int fd, int operation);
int myflock(int fd, int operation);

