Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Some (partial) fixes for cross-compiling to Windows
[simgrid.git] / buildtools / Cmake / test_prog / prog_sem_open.c
1 /* Copyright (c) 2010-2014. The SimGrid Team.
2  * All rights reserved.                                                     */
3
4 /* This program is free software; you can redistribute it and/or modify it
5  * under the terms of the license (GNU LGPL) which comes with this package. */
6
7 #include <sys/types.h>
8 #include <sys/stat.h>
9 #include <fcntl.h>
10 #include <semaphore.h>
11 #include <stdio.h>
12
13 #ifndef SEM_FAILED
14 #define SEM_FAILED (-1)
15 #endif
16
17 int main(void) {
18   sem_t * s;
19    s = sem_open("/0", O_CREAT, 0644, 10);
20    if (s == SEM_FAILED){
21 //     printf("sem_open failed\n");
22      return 1;
23    }
24 //   printf("sem_open succeeded\n");   
25    return 0;
26 }