diff options
author | Raghavendra G <raghavendra@gluster.com> | 2009-09-15 08:06:56 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2009-09-15 07:19:38 -0700 |
commit | e16fc897aeece7598da195bb9bd050e352ff31ec (patch) | |
tree | ff7d20d9ea384ba4afa1698d3d3b552da929a1fa /booster | |
parent | 3508a2d237cee98eb5c890011b569a1820b57f5c (diff) |
booster: use __REDIRECT macro to prevent creat being renamed to creat64.
- nm on libglusterfs-booster.so 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
libglusterfs-booster.so
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 264 (creat is not resolved properly to the symbol defined in booster)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=264
Diffstat (limited to 'booster')
-rw-r--r-- | booster/src/booster.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/booster/src/booster.c b/booster/src/booster.c index f3834e11938..f53772410ce 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)); + int -creat (const char *pathname, mode_t mode) +booster_false_creat (const char *pathname, mode_t mode) { int ret = -1; if (!pathname) { |