bientot fini
This commit is contained in:
parent
06ea466cc1
commit
a18ec05996
1 changed files with 7 additions and 5 deletions
|
@ -3,31 +3,33 @@
|
||||||
|
|
||||||
void * msgBufferMap(msgSpace * space, int poolIndex, int bufferIndex) {
|
void * msgBufferMap(msgSpace * space, int poolIndex, int bufferIndex) {
|
||||||
void * resultAddr;
|
void * resultAddr;
|
||||||
|
int msPoolFd, buffersize;
|
||||||
|
|
||||||
msgBufferInfoTabId bufferInfoTabId;
|
msgBufferInfoTabId bufferInfoTabId;
|
||||||
int bufferInfoTabFd;
|
int bufferInfoTabFd;
|
||||||
|
|
||||||
// TODO: récuperer l'ID du BufferInfoTab;
|
// TODO: récuperer l'ID du BufferInfoTab;
|
||||||
strcpy(bufferInfoTabId, poolDataTabAddr[poolIndex].bufferInfoTabId);
|
//strcpy(bufferInfoTabId, poolDataTabAddr[poolIndex].bufferInfoTabId);
|
||||||
|
|
||||||
|
|
||||||
bufferInfoTabFd=shm_open(bufferInfoTabId,O_RDWR,SHM_DEFAULT_MODE);
|
bufferInfoTabFd=shm_open(bufferInfoTabId,O_RDWR,SHM_DEFAULT_MODE);
|
||||||
if (bufferInfoTabFd<0){
|
if (bufferInfoTabFd<0){
|
||||||
NZG_ERROR("sem_open",bufferInfoTabId);
|
NZG_ERROR("sem_open",bufferInfoTabId);
|
||||||
return -1;
|
goto ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(msPoolFd == -1) {
|
if(bufferInfoTabFd == -1) {
|
||||||
NZG_ERROR("shm_open", space->poolDataTabId);
|
NZG_ERROR("shm_open", bufferInfoTabId);
|
||||||
goto ERROR;
|
goto ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
// mapper le buffer dans l'espace mémoire du processus
|
// mapper le buffer dans l'espace mémoire du processus
|
||||||
resultAddr=mmap(NULL, buffersize, PROT_WRITE|PROT_READ, MAP_SHARED, msPoolFd, (off_t)0);
|
resultAddr=mmap(NULL, buffersize, PROT_WRITE|PROT_READ, MAP_SHARED, msPoolFd, (off_t)0);
|
||||||
|
|
||||||
|
// TODO: poolDataTabId
|
||||||
if(resultAddr == MAP_FAILED) {
|
if(resultAddr == MAP_FAILED) {
|
||||||
NZG_ERROR("mmap", poolDataTabId);
|
//NZG_ERROR("mmap", poolDataTabId);
|
||||||
goto ERROR;
|
goto ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue