Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of scm.gforge.inria.fr:/gitroot/simgrid/simgrid
[simgrid.git] / buildtools / Cmake / test_prog / prog_sem_open.c
index 4679c32..e657cc3 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010. The SimGrid Team.
+/* Copyright (c) 2010-2014. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
 #include <semaphore.h>
 #include <stdio.h>
 
-int main(void) {   
-   sem_t * s;
-   
+#ifndef SEM_FAILED
+#define SEM_FAILED (-1)
+#endif
+
+int main(void) {
+  sem_t * s;
    s = sem_open("/0", O_CREAT, 0644, 10);
    if (s == SEM_FAILED){
 //     printf("sem_open failed\n");