Changeset 2299
- Timestamp:
- 26/09/2008 21:24:11 (3 years ago)
- Location:
- box/trunk/lib/intercept
- Files:
-
- 2 edited
-
intercept.cpp (modified) (5 diffs)
-
intercept.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
box/trunk/lib/intercept/intercept.cpp
r2183 r2299 23 23 24 24 #include <errno.h> 25 #include <stdarg.h> 25 26 26 27 #ifdef HAVE_DLFCN_H … … 233 234 234 235 extern "C" int 235 open(const char *path, int flags, mode_t mode) 236 #ifdef DEFINE_ONLY_OPEN64 237 open64(const char *path, int flags, ...) 238 #else 239 open(const char *path, int flags, ...) 240 #endif // DEFINE_ONLY_OPEN64 236 241 { 237 242 if(intercept_count > 0) … … 246 251 } 247 252 253 mode_t mode = 0; 254 if (flags & O_CREAT) 255 { 256 va_list ap; 257 va_start(ap, flags); 258 mode = va_arg(ap, mode_t); 259 va_end(ap); 260 } 261 248 262 #ifdef PLATFORM_NO_SYSCALL 249 263 int r = TEST_open(path, flags, mode); … … 267 281 } 268 282 283 #ifndef DEFINE_ONLY_OPEN64 269 284 extern "C" int 270 open64(const char *path, int flags, mode_t mode) 271 { 285 // open64(const char *path, int flags, mode_t mode) 286 // open64(const char *path, int flags, ...) 287 open64 (__const char *path, int flags, ...) 288 { 289 mode_t mode = 0; 290 if (flags & O_CREAT) 291 { 292 va_list ap; 293 va_start(ap, flags); 294 mode = va_arg(ap, mode_t); 295 va_end(ap); 296 } 297 272 298 // With _FILE_OFFSET_BITS set to 64 this should really use (flags | 273 299 // O_LARGEFILE) here, but not actually necessary for the tests and not … … 275 301 return open(path, flags, mode); 276 302 } 303 #endif // !DEFINE_ONLY_OPEN64 277 304 278 305 extern "C" int -
box/trunk/lib/intercept/intercept.h
r2183 r2299 24 24 typedef int (closedir_t)(DIR *dir); 25 25 #if defined __GNUC__ && __GNUC__ >= 2 26 #define LINUX_WEIRD_LSTAT 27 #define STAT_STRUCT struct stat /* should be stat64 */ 28 typedef int (lstat_t) (int ver, const char *file_name, 29 STAT_STRUCT *buf); 26 #if _FILE_OFFSET_BITS == 64 27 #define DEFINE_ONLY_OPEN64 28 #endif 29 #define LINUX_WEIRD_LSTAT 30 #define STAT_STRUCT struct stat /* should be stat64 */ 31 typedef int (lstat_t) (int ver, const char *file_name, 32 STAT_STRUCT *buf); 30 33 #else 31 #define STAT_STRUCT struct stat32 typedef int(lstat_t) (const char *file_name,33 STAT_STRUCT *buf);34 #define STAT_STRUCT struct stat 35 typedef int (lstat_t) (const char *file_name, 36 STAT_STRUCT *buf); 34 37 #endif 35 38 }
Note: See TracChangeset
for help on using the changeset viewer.
