summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2000-09-29 04:45:00 +0000
committerAndrew Tridgell <tridge@samba.org>2000-09-29 04:45:00 +0000
commitd8b9ec741cc57b5f3dd1b3ef782a7baed402beaa (patch)
tree924147ac5c0ee9144e747f2e91c882902f3b2d37 /source
parent1ece7f1ffd7d0b61d6acea03819fb857ea556b4b (diff)
downloadsamba-d8b9ec741cc57b5f3dd1b3ef782a7baed402beaa.tar.gz
samba-d8b9ec741cc57b5f3dd1b3ef782a7baed402beaa.tar.xz
samba-d8b9ec741cc57b5f3dd1b3ef782a7baed402beaa.zip
added a hack to get 64 bit locking working with the broken fcntl()
call in glibc 2.1.95. This hack only gets enabled if you define GLIBC_HACK_FCNTL64
Diffstat (limited to 'source')
-rw-r--r--source/include/includes.h13
-rw-r--r--source/lib/system.c14
2 files changed, 27 insertions, 0 deletions
diff --git a/source/include/includes.h b/source/include/includes.h
index a18c8b6d5cb..da16ae16320 100644
--- a/source/include/includes.h
+++ b/source/include/includes.h
@@ -951,5 +951,18 @@ extern int DEBUGLEVEL;
#define MAX_SEC_CTX_DEPTH 8 /* Maximum number of security contexts */
+
+#ifdef GLIBC_HACK_FCNTL64
+/* this is a gross hack. 64 bit locking is completely screwed up on
+ i386 Linux in glibc 2.1.95 (which ships with RedHat 7.0). This hack
+ "fixes" the problem with the current 2.4.0test kernels
+*/
+#define fcntl fcntl64
+#undef F_SETLKW
+#undef F_SETLK
+#define F_SETLK 13
+#define F_SETLKW 14
+#endif
+
#endif /* _INCLUDES_H */
diff --git a/source/lib/system.c b/source/lib/system.c
index 479bce19659..e846e4755ec 100644
--- a/source/lib/system.c
+++ b/source/lib/system.c
@@ -1013,3 +1013,17 @@ int sys_pclose(int fd)
return -1;
return wstatus;
}
+
+
+
+#if GLIBC_HACK_FCNTL64
+#include <asm/unistd.h>
+/* this is a gross hack. 64 bit locking is completely screwed up on
+ i386 Linux in glibc 2.1.95 (which ships with RedHat 7.0). This hack
+ "fixes" the problem with the current 2.4.0test kernels
+*/
+int fcntl64(int fd, int cmd, struct flock * lock)
+{
+ return syscall(__NR_fcntl64, fd, cmd, lock);
+}
+#endif /* HACK_FCNTL64 */