From ce7be1804398c1d672545cdd80ee93246735c790 Mon Sep 17 00:00:00 2001 From: Assar Westerlund Date: Fri, 1 Aug 1997 16:18:48 +0000 Subject: [PATCH] flock replacement git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@2690 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/roken/roken.h | 17 +++++++++++++++++ lib/roken/roken.h.in | 17 +++++++++++++++++ 2 files changed, 34 insertions(+) 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