[rock-devel] [PATCH] large file support (LFS) for fl_wrapper
Rene Rebe
rene at exactcode.de
Mon Apr 18 08:38:00 CEST 2005
Hi all,
to finalize our T2 OpenOffice package, I had to fix the fl_wrapper to be
able to write logs exceeding 2GB on 32bit architectures such as x86 and
PowerPC.
I though you might be interested as well - so I rediffed it for ROCK
Linux trunk:HEAD.
PS: Please do not forget to regenerate your fl_wrapper.c from the .sh.
Yours,
PPS: I'm still not on the list - thus please CC me on reply.
--
René Rebe - Rubensstr. 64 - 12157 Berlin (Europe / Germany)
http://www.exactcode.de/ | http://www.t2-project.org/
+49 (0)30 255 897 45
-------------- next part --------------
Added large file support to the flist wrapper. Rediffed for ROCK Linux HEAD.
- Rene Rebe <rene at exactcode.de>
--- t2/misc/tools-source/fl_wrapper.c.sh (revision 8291)
+++ t2/misc/tools-source/fl_wrapper.c.sh (revision 8343)
@@ -27,6 +27,8 @@
*
* --- ROCK-COPYRIGHT-NOTE-END ---
*
+ * Copyright (C) 2004-2005 The T2 SDE Project
+ *
* gcc -Wall -O2 -ldl -shared -o fl_wrapper.so fl_wrapper.c
*
* !!! THIS FILE IS AUTO-GENERATED BY $0 !!!
@@ -50,6 +52,9 @@
#define open64 xxx_open64
#define mknod xxx_mknod
+#define _LARGEFILE_SOURCE
+#define _LARGEFILE64_SOURCE
+
# include <dlfcn.h>
# include <errno.h>
# include <fcntl.h>
@@ -62,6 +67,9 @@
# include <utime.h>
# include <stdarg.h>
+#undef _LARGEFILE64_SOURCE
+#undef _LARGEFILE_SOURCE
+
#undef mknod
#undef open
#undef open64
@@ -327,7 +335,12 @@
else { logfile = rlog; }
if ( logfile == 0 ) return;
+#ifdef __USE_LARGEFILE
+ fd=open64(logfile,O_APPEND|O_WRONLY|O_LARGEFILE,0);
+#else
+#warning "The wrapper library will not work properly for large logs!"
fd=open(logfile,O_APPEND|O_WRONLY,0);
+#endif
if (fd == -1) return;
if (file[0] == '/') {
More information about the rock-devel
mailing list