1#ifndef __SEMAPHORE_MFP_H 2#define __SEMAPHORE_MFP_H 3 4#pragma pack(1) 5 6#define SEM_MAGIC 0x89674523 7#define SEM_NAME "/tmp/Semaphore" 8#define FILE_MODE (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH) 9 10typedef struct 11{ 12 int sem_fd[2]; 13 int sem_magic; 14}semaphore_t; 15 16semaphore_t Semaphore; 17 18int semaphore_create(); 19int semaphore_close(); 20int semaphore_open(const char *, int, ... ); 21int semaphore_unlink(const char *); 22int semaphore_post(); 23int semaphore_wait(); 24 25#pragma pack() 26 27#endif 28