summaryrefslogtreecommitdiff
path: root/source4/heimdal_build/replace.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-07-14 06:36:19 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:23:04 -0500
commitaf0574378b3e73ffe637618e2f504d58735d6543 (patch)
tree9b2324820e185fc56bbb8e9a9be0bc172d17c6ea /source4/heimdal_build/replace.c
parent7175419589455001f473926d574e1ca3359089ee (diff)
downloadsamba-af0574378b3e73ffe637618e2f504d58735d6543.tar.gz
samba-af0574378b3e73ffe637618e2f504d58735d6543.tar.bz2
samba-af0574378b3e73ffe637618e2f504d58735d6543.zip
r8450: more configure tests for solaris. It now builds some binaries, but
fails in the ejs floating point code. (This used to be commit 30e1b6140e9f6246cb66eef7cf108d1ccf62bd40)
Diffstat (limited to 'source4/heimdal_build/replace.c')
-rw-r--r--source4/heimdal_build/replace.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/source4/heimdal_build/replace.c b/source4/heimdal_build/replace.c
index 0b7e1943f8..46019d7bb5 100644
--- a/source4/heimdal_build/replace.c
+++ b/source4/heimdal_build/replace.c
@@ -24,6 +24,7 @@
#include "config.h"
#include <stdio.h>
#include "err.h"
+#include "roken.h"
#ifndef HAVE_ERR
void err(int eval, const char *format, ...)
@@ -47,3 +48,31 @@
exit(eval);
}
#endif
+
+#ifndef HAVE_WARNX
+ void warnx(const char *format, ...)
+{
+ va_list ap;
+ va_start(ap, format);
+ vfprintf(stderr, format, ap);
+ va_end(ap);
+}
+#endif
+
+#ifndef HAVE_FLOCK
+ int flock(int fd, int op)
+{
+ switch (op & (LOCK_UN|LOCK_SH|LOCK_EX)) {
+ case LOCK_UN:
+ return fcntl_lock(fd, F_SETLK, 0, 0, F_UNLCK);
+ case LOCK_SH:
+ return fcntl_lock(fd, (op&LOCK_NB)?F_SETLK:F_SETLKW,
+ 0, 0, F_RDLCK);
+ case LOCK_EX:
+ return fcntl_lock(fd, (op&LOCK_NB)?F_SETLK:F_SETLKW,
+ 0, 0, F_WRLCK);
+ }
+ errno = EINVAL;
+ return -1;
+}
+#endif