semaphores.h
Go to the documentation of this file.
00001 #ifndef __SEMAPHORES_H_
00002 #define __SEMAPHORES_H_
00003 
00029 #include <sys/types.h>
00030 #include <sys/stat.h>
00031 #include <stdio.h>
00032 #include <stdlib.h>
00033 #include <string.h>
00034 #include <math.h>
00035 #include <errno.h>
00036 #include <unistd.h>
00037 #include <sys/sem.h>
00038 #include <sys/ipc.h>
00039 #include <fcntl.h>
00040 
00041 #ifdef __cplusplus
00042 extern "C" {
00043 #endif
00044 
00045 #define MAX_SEMFILENAME_SIZE 128
00046 
00050     typedef struct semaphore {
00051             char semFile[MAX_SEMFILENAME_SIZE];
00052             int semID;
00053             key_t semKey;
00054     } semaphore_t;
00055 
00066     int createKey(key_t *, char[]);
00067 
00078     int getSemID(key_t, int * semID);
00079 
00086     int rmSem(int semID);
00087 
00094     int waitSem(int semID);
00095 
00102     int freeSem(int semID);
00103 
00104 #ifdef __cplusplus
00105 }
00106 #endif
00107 
00108 #endif


sr_communications
Author(s): Raul Perula-Martinez , Victor Gonzalez
autogenerated on Wed Aug 26 2015 16:26:47