Changeset 74369


Ignore:
Timestamp:
Dec 14, 2010, 11:05:07 AM (8 years ago)
Author:
jmr@…
Message:

only use stat64 and friends when available, as per jeremyhu's suggestion on the list

Location:
trunk/base/src/darwintracelib1.0
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/src/darwintracelib1.0/Makefile

    r74318 r74369  
    88
    99CFLAGS+= -fPIC
    10 # will need to update this to cope with 64-bit inodes someday
    11 CPPFLAGS+= -D_DARWIN_NO_64_BIT_INODE
    1210
    1311all:: ${SHLIB_NAME}
  • trunk/base/src/darwintracelib1.0/darwintrace.c

    r74318 r74369  
    3939#endif
    4040
     41#if HAVE_SYS_CDEFS_H
     42#include <sys/cdefs.h>
     43#endif
     44#if defined(_DARWIN_FEATURE_64_BIT_INODE) && !defined(_DARWIN_FEATURE_ONLY_64_BIT_INODE)
     45/* The architecture we're building for has multiple versions of stat.
     46   We need to undo sys/cdefs.h changes for _DARWIN_FEATURE_64_BIT_INODE */
     47#undef  __DARWIN_64_BIT_INO_T
     48#define __DARWIN_64_BIT_INO_T 0
     49#undef  __DARWIN_SUF_64_BIT_INO_T
     50#define __DARWIN_SUF_64_BIT_INO_T ""
     51#undef _DARWIN_FEATURE_64_BIT_INODE
     52#endif
     53
    4154#ifdef HAVE_CRT_EXTERNS_H
    4255#include <crt_externs.h>
     
    466479static int is_directory(const char * path)
    467480{
    468 /* will need to update this to cope with 64-bit inodes someday - for now, we
    469  build with -D_DARWIN_NO_64_BIT_INODE */
    470481#define stat(path, sb) syscall(SYS_stat, path, sb)
    471482        struct stat s;
     
    923934}
    924935
     936#if defined(__DARWIN_64_BIT_INO_T) && !defined(_DARWIN_FEATURE_ONLY_64_BIT_INODE)
     937
    925938int stat64(const char * path, struct stat64 * sb)
    926939{
     
    951964}
    952965
     966#endif /* defined(__DARWIN_64_BIT_INO_T) && !defined(_DARWIN_FEATURE_ONLY_64_BIT_INODE) */
     967
     968
    953969int lstat(const char * path, struct stat * sb)
    954970{
     
    974990}
    975991
     992#if defined(__DARWIN_64_BIT_INO_T) && !defined(_DARWIN_FEATURE_ONLY_64_BIT_INODE)
     993
    976994int lstat64(const char * path, struct stat64 * sb)
    977995{
     
    10011019    return lstat64(path, sb);
    10021020}
     1021
     1022#endif /* defined(__DARWIN_64_BIT_INO_T) && !defined(_DARWIN_FEATURE_ONLY_64_BIT_INODE) */
Note: See TracChangeset for help on using the changeset viewer.