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
1 /* Copyright (c) 2010. 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 int main(void) {   
14    sem_t * s;
15    
16    s = sem_open("/0", O_CREAT, 0644, 10);
17    if (s == SEM_FAILED){
18 //     printf("sem_open failed\n");
19      return 1;
20    }
21 //   printf("sem_open succeeded\n");   
22    return 0;
23 }