Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Dig through git history, and update copyright lines.
[simgrid.git] / buildtools / Cmake / test_prog / prog_sem_open.c
1 /* Copyright (c) 2010-2012. 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 #ifdef WIN32
19   int s;
20 #else
21   sem_t * s;
22 #endif
23    s = sem_open("/0", O_CREAT, 0644, 10);
24    if (s == SEM_FAILED){
25 //     printf("sem_open failed\n");
26      return 1;
27    }
28 //   printf("sem_open succeeded\n");   
29    return 0;
30 }