Ported TSAN test 98 to Darwin.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10557 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/drd/tests/tsan_unittest.cpp b/drd/tests/tsan_unittest.cpp
index bd3ec94..116908f 100644
--- a/drd/tests/tsan_unittest.cpp
+++ b/drd/tests/tsan_unittest.cpp
@@ -4773,10 +4773,15 @@
   char out_name[100];
   // we open two files, on for reading and one for writing, 
   // but the files are actually the same (symlinked).
-  sprintf(in_name,  "/tmp/racecheck_unittest_in.%d", getpid());
   sprintf(out_name, "/tmp/racecheck_unittest_out.%d", getpid());
   fd_out = creat(out_name, O_WRONLY | S_IRWXU);
+#ifdef __APPLE__
+  // symlink() is not supported on Darwin. Copy the output file name.
+  strcpy(in_name, out_name);
+#else
+  sprintf(in_name,  "/tmp/racecheck_unittest_in.%d", getpid());
   IGNORE_RETURN_VALUE(symlink(out_name, in_name));
+#endif
   fd_in  = open(in_name, 0, O_RDONLY);
   CHECK(fd_out >= 0);
   CHECK(fd_in  >= 0);