*** empty log message ***

This commit is contained in:
glenux 2004-02-19 21:21:52 +00:00
parent 7d2ac0ca87
commit c760b616ec
4 changed files with 27 additions and 10 deletions

View file

@ -11,5 +11,7 @@
#include <errno.h>
#define PAGESIZE sysconf(_SC_PAGESIZE)
#define MSGSPACE_DEFAULT_MODE 0600
#define MSGSPACE_ID_LEN 32
#endif

View file

@ -1,11 +1,7 @@
#ifndef _NZG_IFACE
#define _NZG_IFACE 1
#include "nzg_global.h"
#define MSGSPACE_DEFAULT_MODE 0600
#define MSGSPACE_ID_LEN 32
typedef char msgSpaceId[MSGSPACE_ID_LEN];
typedef char msgSpaceListId[4*MSGSPACE_ID_LEN];
@ -19,12 +15,17 @@ typedef char msgSpaceQueueId[4*MSGSPACE_ID_LEN];
/* pid[] */
/* liste des processus demandeurs */
typedef struct MsgPool {
int bufferSize;
int bufferNb;
} msgPool;
typedef struct MsgPoolData {
msgSpacePoolId id;
int bufferNb;
int bufferSize;
int allocDispBuffer;
int allocOverload;
} msgPool;
} msgPoolData;
/* TODO: queueId */

View file

@ -55,9 +55,15 @@ int msgSpacePoolId2nzgPoolId(msgSpacePoolId dest,msgSpacePoolId src, int num){
// //donne l'adr en mappant in the memory
//poolAddr = mmap(NULL, sizeof(*msgPool), PROT_NONE, MAP_SHARED, poolFd, 0);
msgPool * msgPoolAllocate(int poolFd, msgSpace *msg) {
msgPool * msgPoolAllocate(int poolIdx, msgSpace *msg) {
msgPool * poolAddr;
int dataId;
// TODO:récupérer l'id du poolData dans le msgSpace
// détacher le morceau de mémoire du processus
// TODO:récupérer l'id de la pool (poolIdx) qui nous intéresse
// ouvrir la
//msgSpacePoolData spoolData;
//dataId = msg->poolDataId;

View file

@ -1,7 +1,11 @@
#include "libnazgul.h"
/* prototypes des fonctions annexes à ne pas exporter */
int msgSpaceIdIntern(msgSpaceId dest,const msgSpaceId src );
/* prototypes des f#define MSGSPACE_DEFAULT_MODE 0600
#define MSGSPACE_ID_LEN 32
onctions annexes à ne pas exporter */
int msgSpaceIdIntern(msgSpaceId dest,const msgSpaceId src );
int msgPoolDataIdIntern(msgSpaceId dest,const msgSpaceId src );
/*
* spaceId : identifiant externe de l'espace de msg
@ -22,6 +26,8 @@ msgSpace * msgSpaceCreate(
static int mSIdNum=-1;
msgSpace * mSAddr;
msgSpacePoolId poolDataId;
msgPoolData * mSPoolDataAddr;
fprintf(stderr,"Creating msgSpace with id : %s\n",spaceId);
@ -77,7 +83,9 @@ msgSpace * msgSpaceCreate(
mSAddr->pid=getpid();
/* TODO: creation du poolData */
msgPoolDataIdIntern(poolDataId,spaceId);
/* TODO: on ajoute spaceId a la liste des msgSpace connus */
/* TODO: on crée queueNb files de messages */
@ -143,7 +151,7 @@ int msgSpaceIdIntern(msgSpaceId dest,const msgSpaceId src ){
return 0;
}
int msgSpacePoolDataIdIntern(msgSpaceId dest,const msgSpaceId src ){
int msgPoolDataIdIntern(msgSpaceId dest,const msgSpaceId src ){
if (strlen(src)>MSGSPACE_ID_LEN){
return -1;
}