
When linking an application that doesn't use Large File Support with the
library (which does), several problems might arise from the data size
differences.

It's very important that everything uses the same interface. Since there's no
portable way to force the application we're linking with uses LFS, we just
give an error in case they don't. It might seem uglier, but it's a lot safer.


---

 cur-root/libjio.h |   10 ++++++++++
 1 files changed, 10 insertions(+)

diff -puN libjio.h~check_lfs libjio.h
--- cur/libjio.h~check_lfs	2004-09-19 01:32:35.665451616 -0300
+++ cur-root/libjio.h	2004-09-19 01:32:35.668451160 -0300
@@ -12,6 +12,16 @@
 #include <sys/types.h>
 #include <sys/uio.h>
 #include <pthread.h>
+#include <unistd.h>
+
+/* Check if we're using Large File Support - otherwise refuse to build.
+ * Otherwise, we would allow applications not using LFS to link with the
+ * library (which uses LFS) and that's just begging for problems. There should
+ * be a portable way for the C library to do some of this for us, but until I
+ * find one, this is the best we can do */
+#if (!defined _FILE_OFFSET_BITS) && (_FILE_OFFSET_BITS != 64)
+#error "You must compile your application with Large File Support"
+#endif
 
 #ifdef __cplusplus
 extern "C" {
_
