diff --git a/lib/roken/roken.h b/lib/roken/roken.h index 902ab0c8e..0e958f99d 100644 --- a/lib/roken/roken.h +++ b/lib/roken/roken.h @@ -222,6 +222,23 @@ int rcmd(char **ahost, unsigned short inport, const char *locuser, const char *remuser, const char *cmd, int *fd2p); #endif +#ifndef HAVE_FLOCK +#ifndef LOCK_SH +#define LOCK_SH 1 /* Shared lock */ +#endif +#ifndef LOCK_EX +#define LOCK_EX 2 /* Exclusive lock */ +#endif +#ifndef LOCK_NB +#define LOCK_NB 4 /* Don't block when locking */ +#endif +#ifndef LOCK_UN +#define LOCK_UN 8 /* Unlock */ +#endif + +int flock(int fd, int operation); +#endif /* HAVE_FLOCK */ + #ifdef TIME_WITH_SYS_TIME #include #include diff --git a/lib/roken/roken.h.in b/lib/roken/roken.h.in index 902ab0c8e..0e958f99d 100644 --- a/lib/roken/roken.h.in +++ b/lib/roken/roken.h.in @@ -222,6 +222,23 @@ int rcmd(char **ahost, unsigned short inport, const char *locuser, const char *remuser, const char *cmd, int *fd2p); #endif +#ifndef HAVE_FLOCK +#ifndef LOCK_SH +#define LOCK_SH 1 /* Shared lock */ +#endif +#ifndef LOCK_EX +#define LOCK_EX 2 /* Exclusive lock */ +#endif +#ifndef LOCK_NB +#define LOCK_NB 4 /* Don't block when locking */ +#endif +#ifndef LOCK_UN +#define LOCK_UN 8 /* Unlock */ +#endif + +int flock(int fd, int operation); +#endif /* HAVE_FLOCK */ + #ifdef TIME_WITH_SYS_TIME #include #include