ipc.h
上传用户:sdtbys
上传日期:2009-12-06
资源大小:13k
文件大小:1k
- #ifndef MY_IPC_H
- #define MY_IPC_H
- #define MsgCreateFail -1301
- #define MsgOpenFail -1302
- #define MsgStateFail -1303
- #define MsgMesgLenBad -1304
- #define MsgSendFail -1305
- #define MsgRecvFail -1306
- #define MsgRemoveFail -1307
- #define MsgTimeOut -1308
- #define MsgOK 0
- #define SemCreateFail -1321
- #define SemOpenFail -1322
- #define SemSetValFail -1323
- #define SemLockFail -1324
- #define SemUnlockFail -1325
- #define SemRemoveFail -1326
- #define ShmCreateFail -1331
- #define ShmOpenFail -1332
- #define ShmRemoveFail -1333
- #define ShmConnectFail -1334
- #define ShmDisConnectF -1335
- #define MaxMesgLen 1024
- #define QPERM 0666
- typedef struct {
- long MesgId;
- char MesgText[MaxMesgLen+1];
- } Mesg;
- int msgCreate(key_t key);
- int msgOpen(key_t key);
- int msgSend(int Msgfd,long MsgId,char *MsgText,int MsgTextLen);
- int msgRecv(int Msgfd,long *MsgId,char *MsgText,int MsgTextLen);
- int msgRemove(int Msgfd);
- int msgStatus(int Msgfd);
- int semCreate(key_t key);
- int semOpen(key_t key);
- int semLock(int iSemId);
- int semUnlock(int iSemId);
- int semRemove(int iSemId);
- int semGetVal(int iSemId);
- int semSetVal(int iSemId,int val);
- int shmCreate(key_t key,int size);
- int shmOpen(key_t key,int size);
- int shmRemove(int iShmId);
- char *shmConnect(int iShmId);
- int shmDisConnect(char *addr);
- #endif