Print an error message if sem_init() is called by a client program on Darwin.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10565 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/drd/drd_semaphore.c b/drd/drd_semaphore.c
index f2e38e2..e064310 100644
--- a/drd/drd_semaphore.c
+++ b/drd/drd_semaphore.c
@@ -200,7 +200,18 @@
    }
    else
    {
+#if defined(VGO_darwin)
+      const ThreadId vg_tid = VG_(get_running_tid)();
+      GenericErrInfo GEI = { DRD_(thread_get_running_tid)() };
+      VG_(maybe_record_error)(vg_tid,
+			      GenericErr,
+			      VG_(get_IP)(vg_tid),
+			      "sem_init() is not yet supported on Darwin",
+			      &GEI);
+      return NULL;
+#else
       p = drd_semaphore_get_or_allocate(semaphore);
+#endif
    }
    tl_assert(p);
    p->waits_to_skip = value;