Modified: branches/gsoc11-statistics/base/src/darwintracelib1.0/Makefile (105637 => 105638)
--- branches/gsoc11-statistics/base/src/darwintracelib1.0/Makefile 2013-04-29 08:42:46 UTC (rev 105637)
+++ branches/gsoc11-statistics/base/src/darwintracelib1.0/Makefile 2013-04-29 13:31:45 UTC (rev 105638)
@@ -2,8 +2,6 @@
SHLIB_NAME= darwintrace${SHLIB_SUFFIX}
INSTALLDIR= ${DESTDIR}${datadir}/macports/Tcl/darwintrace1.0
-test::
-
include ../../Mk/macports.autoconf.mk
CFLAGS+= -fPIC -Wno-deprecated-declarations
@@ -22,3 +20,5 @@
install:: all
$(INSTALL) -d -o ${DSTUSR} -g ${DSTGRP} -m ${DSTMODE} ${INSTALLDIR}
$(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 444 ${SHLIB_NAME} ${INSTALLDIR}
+
+test::
Modified: branches/gsoc11-statistics/base/src/darwintracelib1.0/darwintrace.c (105637 => 105638)
--- branches/gsoc11-statistics/base/src/darwintracelib1.0/darwintrace.c 2013-04-29 08:42:46 UTC (rev 105637)
+++ branches/gsoc11-statistics/base/src/darwintracelib1.0/darwintrace.c 2013-04-29 13:31:45 UTC (rev 105638)
@@ -1087,22 +1087,14 @@
* other systems, and because other system's syscall names are probably
* different anyway */
-#pragma pack(4)
-struct dirent32 {
- ino_t d_ino; /* file number of entry */
- __uint16_t d_reclen; /* length of this record */
- __uint8_t d_type; /* file type, see below */
- __uint8_t d_namlen; /* length of string in d_name */
- char d_name[__DARWIN_MAXNAMLEN + 1]; /* name must be no longer than this */
-};
-#pragma pack()
+#if defined(__DARWIN_64_BIT_INO_T)
struct dirent64 {
__uint64_t d_ino; /* file number of entry */
- __uint64_t d_seekoff; /* seek offset (optional, used by servers) */
+ __uint64_t d_seekoff; /* seek offset */
__uint16_t d_reclen; /* length of this record */
__uint16_t d_namlen; /* length of string in d_name */
- __uint8_t d_type; /* file type, see below */
+ __uint8_t d_type; /* file type */
char d_name[__DARWIN_MAXPATHLEN]; /* entry name (up to MAXPATHLEN bytes) */
};
@@ -1114,7 +1106,7 @@
if (-1 == fcntl(fd, F_GETPATH, dirname)) {
errno = EBADF;
- return 0;
+ return -1;
}
dnamelen = strlen(dirname);
@@ -1143,6 +1135,18 @@
#undef __getdirentries64
}
+#endif /* defined(__DARWIN_64_BIT_INO_T) */
+
+#pragma pack(4)
+struct dirent32 {
+ ino_t d_ino; /* file number of entry */
+ __uint16_t d_reclen; /* length of this record */
+ __uint8_t d_type; /* file type */
+ __uint8_t d_namlen; /* length of string in d_name */
+ char d_name[__DARWIN_MAXNAMLEN + 1]; /* name must be no longer than this */
+};
+#pragma pack()
+
int getdirentries(int fd, char *buf, int nbytes, long *basep) {
#define getdirentries(w,x,y,z) syscall(SYS_getdirentries, (w), (x), (y), (z))
size_t sz = getdirentries(fd, buf, nbytes, basep);