path: root/booster
diff options
authorRaghavendra G <>2009-09-15 08:03:46 +0000
committerAnand V. Avati <>2009-09-15 07:19:49 -0700
commitca586f1b9f9f2848eeb8bb6a22f20851f8a117d6 (patch)
treed1d33bd5ee6d75dcf2cbb84cf3c453656ff59b66 /booster
parent2cd45bcd9f252616c735284516c1f3ac07de00d9 (diff)
booster: use __REDIRECT macro to prevent creat being renamed to creat64.
- nm on shows only creat64 defined but not creat. This behavior is observed due to following reasons. 1. Booster is compiled with _FILE_OFFSET_BITS=64. 2. fcntl.h when included with _FILE_OFFSET_BITS=64 defined, renames all occurences of creat to creat64 in the source code from the point of #include <fcntl.h>. fcntl.h should be included since booster.c uses many of the macros defined in that header and glusterfs (booster in turn) has to be compiled with _FILE_OFFSET_BITS=64 since glusterfs uses datatypes (off_t, stat etc) whose sizes vary depending on whether this macro is defined or not. Basically, this macro should be defined to provide portability across 32 and 64 bit architectures. The correct fix is to make glusterfs to use datatypes big enough to hold 64 bit variants as well as 32 bit variants (like int64_t replacing off_t) and not to define _FILE_OFFSET_BITS=64 at all. As a temporary work around, 1. we can implement creat functionality in a function with different name, say booster_false_creat 2. rename this function to creat using __REDIRECT macro. since this renaming happens after renaming of creat to creat64 (from the first __REDIRECT macro in fcntl.h), we will end up with creat symbol being defined in Signed-off-by: Anand V. Avati <> BUG: 264 (creat is not resolved properly to the symbol defined in booster) URL:
Diffstat (limited to 'booster')
1 files changed, 4 insertions, 1 deletions
diff --git a/booster/src/booster.c b/booster/src/booster.c
index f3834e1..f537724 100644
--- a/booster/src/booster.c
+++ b/booster/src/booster.c
@@ -595,8 +595,11 @@ out:
return -1;
+int __REDIRECT (booster_false_creat, (const char *pathname, mode_t mode),
+ creat) __nonnull ((1));
-creat (const char *pathname, mode_t mode)
+booster_false_creat (const char *pathname, mode_t mode)
int ret = -1;
if (!pathname) {