summaryrefslogtreecommitdiff
path: root/include/libbb.h
diff options
context:
space:
mode:
authorDenis Vlasenko2006-10-07 16:24:46 +0000
committerDenis Vlasenko2006-10-07 16:24:46 +0000
commit5625415085e68ac5e150f54e685417c866620d76 (patch)
tree4146667d4080f97bc39ac96d844c01a8956aeeca /include/libbb.h
parent890ac9deb2cc57cadd7aba4ee91bd012e19e239d (diff)
downloadbusybox-5625415085e68ac5e150f54e685417c866620d76.zip
busybox-5625415085e68ac5e150f54e685417c866620d76.tar.gz
dd: make it recognize not only 'k' but 'K' too;
make it (partially) CONFIG_LFS-aware
Diffstat (limited to 'include/libbb.h')
-rw-r--r--include/libbb.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/include/libbb.h b/include/libbb.h
index 84c8af4..11e1e62 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -61,6 +61,31 @@
#define PATH_MAX 256
#endif
+/* Large file support */
+#ifdef CONFIG_LFS
+# define FILEOFF_TYPE off64_t
+# define FILEOFF_FMT "%lld"
+# define LSEEK lseek64
+# define STAT stat64
+# define LSTAT lstat64
+# define STRUCT_STAT struct stat64
+# define STRTOOFF strtoll
+# define SAFE_STRTOOFF safe_strtoll
+#else
+# define FILEOFF_TYPE off_t
+# define FILEOFF_FMT "%ld"
+# define LSEEK lseek
+# define STAT stat
+# define LSTAT lstat
+# define STRUCT_STAT struct stat
+# define STRTOOFF strtol
+# define SAFE_STRTOOFF safe_strtol
+/* Do we need to undefine O_LARGEFILE? */
+#endif
+/* scary. better ideas? (but do *test* them first!) */
+#define MAX_FILEOFF_TYPE \
+ ((FILEOFF_TYPE)~((FILEOFF_TYPE)1 << (sizeof(FILEOFF_TYPE)*8-1)))
+
/* Some useful definitions */
#undef FALSE
#define FALSE ((int) 0)