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 /xlators | |
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 'xlators')
0 files changed, 0 insertions, 0 deletions