Revision: 985 http://trac.macosforge.org/projects/darwinbuild/changeset/985 Author: kvv@apple.com Date: 2011-11-17 13:45:49 -0800 (Thu, 17 Nov 2011) Log Message: ----------- darwinbuild-26.4 Modified Paths: -------------- trunk/CHANGES trunk/darwintrace/darwintrace.c Property Changed: ---------------- trunk/ Property changes on: trunk ___________________________________________________________________ Modified: svn:mergeinfo - /branches/PR-10363375:959-960 /branches/PR-10397485:967 /branches/PR-10412052:973-975 /branches/PR-10412066:974-975 /branches/PR-10431324:979-980 /branches/PR-4841388:399-419 /branches/PR-6358021:442-443 /branches/PR-6392966:423-427 /branches/PR-6398060:433-434 /branches/PR-6493844:460-461 /branches/PR-6497694:466-468,471 /branches/PR-6634286:632-650 /branches/PR-6688645:479-490 /branches/PR-6722857:495-499 /branches/PR-6729491:655-664 /branches/PR-6973110:804-813 /branches/PR-7250612:635-650 /branches/PR-7341154:682-694 /branches/PR-7431723:660-664 /branches/PR-7461534:650-664 /branches/PR-7482850:670-671 /branches/PR-7489777:676-731 /branches/PR-7529688:692-694 /branches/PR-7593824:739-772 /branches/PR-7598640:703-731 /branches/PR-7748469:777-785 /branches/PR-7765119:790-791 /branches/PR-7798586:796-799 /branches/PR-7872907:830-840 /branches/PR-7935095:819-821 /branches/PR-8116613:849 /branches/PR-8279204:854-862 /branches/PR-8416637:870-880 /branches/PR-8486662:885-889 /branches/PR-8488185:894-898 /branches/PR-8604911:903-905 /branches/PR-8817822:917-933 /branches/PR-8908468:912 + /branches/PR-10008999:984 /branches/PR-10363375:959-960 /branches/PR-10397485:967 /branches/PR-10412052:973-975 /branches/PR-10412066:974-975 /branches/PR-10431324:979-980 /branches/PR-4841388:399-419 /branches/PR-6358021:442-443 /branches/PR-6392966:423-427 /branches/PR-6398060:433-434 /branches/PR-6493844:460-461 /branches/PR-6497694:466-468,471 /branches/PR-6634286:632-650 /branches/PR-6688645:479-490 /branches/PR-6722857:495-499 /branches/PR-6729491:655-664 /branches/PR-6973110:804-813 /branches/PR-7250612:635-650 /branches/PR-7341154:682-694 /branches/PR-7431723:660-664 /branches/PR-7461534:650-664 /branches/PR-7482850:670-671 /branches/PR-7489777:676-731 /branches/PR-7529688:692-694 /branches/PR-7593824:739-772 /branches/PR-7598640:703-731 /branches/PR-7748469:777-785 /branches/PR-7765119:790-791 /branches/PR-7798586:796-799 /branches/PR-7872907:830-840 /branches/PR-7935095:819-821 /branches/PR-8116613:849 /branches/PR-8279204:854-862 /branches/PR-8416637:870-880 /branches/PR-8486662:885-889 /branches/PR-8488185:894-898 /branches/PR-8604911:903-905 /branches/PR-8817822:917-933 /branches/PR-8908468:912 Modified: trunk/CHANGES =================================================================== --- trunk/CHANGES 2011-11-17 21:45:28 UTC (rev 984) +++ trunk/CHANGES 2011-11-17 21:45:49 UTC (rev 985) @@ -1,5 +1,8 @@ Darwin Build Scripts Change History ----------------------------------- +Release 26.4 [17-Nov-2011] + - darwintrace: files opened with fopen(3) are missing from trace log + Release 26.3 [11-Nov-2011] - darwintrace: darwintrace_make_environ bug unsets DYLD_INSERT_LIBRARIES Modified: trunk/darwintrace/darwintrace.c =================================================================== --- trunk/darwintrace/darwintrace.c 2011-11-17 21:45:28 UTC (rev 984) +++ trunk/darwintrace/darwintrace.c 2011-11-17 21:45:49 UTC (rev 985) @@ -56,9 +56,18 @@ #define dprintf(...) #endif +#define LION_OR_LATER (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && \ +__MAC_OS_X_VERSION_MIN_REQUIRED >= 1070) + #define DARWINTRACE_INTERPOSE(_replacement,_replacee) \ -__attribute__((used)) static struct{ const void* replacement; const void* replacee; } _interpose_##_replacee \ -__attribute__ ((section ("__DATA,__interpose"))) = { (const void*)(unsigned long)&_replacement, (const void*)(unsigned long)&_replacee }; +__attribute__((used)) static struct { \ + const void* replacement; \ + const void* replacee; \ +} _interpose_##_replacee \ +__attribute__ ((section ("__DATA,__interpose"))) = { \ + (const void*)(unsigned long)&_replacement, \ + (const void*)(unsigned long)&_replacee \ +} static int darwintrace_fd = -2; static char darwintrace_progname[DARWINTRACE_BUFFER_SIZE]; @@ -332,7 +341,11 @@ darwintrace_free_path(redirpath, path); return result; } -DARWINTRACE_INTERPOSE(darwintrace_open, open) +DARWINTRACE_INTERPOSE(darwintrace_open, open); +#if LION_OR_LATER +extern int __open_nocancel(const char* path, int flags, ...); +DARWINTRACE_INTERPOSE(darwintrace_open, __open_nocancel); +#endif /* @@ -362,7 +375,7 @@ darwintrace_free_path(redirpath, path); return result; } -DARWINTRACE_INTERPOSE(darwintrace_readlink, readlink) +DARWINTRACE_INTERPOSE(darwintrace_readlink, readlink); static inline int has_prefix(const char *s, const char *p) { return (strncmp(s, p, strlen(p)) == 0); @@ -444,7 +457,7 @@ free((char*)envp); } -void darwintrace_log_exec(const char* redirpath, char* const argv[]) { +static void darwintrace_log_exec(const char* redirpath, char* const argv[]) { darwintrace_setup(); if (darwintrace_fd >= 0) { struct stat sb; @@ -574,10 +587,9 @@ darwintrace_free_path(redirpath, path); return result; } -DARWINTRACE_INTERPOSE(darwintrace_execve, execve) +DARWINTRACE_INTERPOSE(darwintrace_execve, execve); -#if defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && \ - __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_7 +#if LION_OR_LATER /* weak import __posix_spawn which only exists on 10.7 or later */ extern __attribute__((weak_import)) int __posix_spawn(pid_t * __restrict, const char * __restrict, @@ -598,7 +610,7 @@ darwintrace_free_path(redirpath, path); return result; } -DARWINTRACE_INTERPOSE(darwintrace_posix_spawn, __posix_spawn) +DARWINTRACE_INTERPOSE(darwintrace_posix_spawn, __posix_spawn); #endif /* @@ -613,4 +625,8 @@ return close(fd); } -DARWINTRACE_INTERPOSE(darwintrace_close, close) +DARWINTRACE_INTERPOSE(darwintrace_close, close); +#if LION_OR_LATER +extern int __close_nocancel(int); +DARWINTRACE_INTERPOSE(darwintrace_close, __close_nocancel); +#endif
participants (1)
-
source_changes@macosforge.org