*** 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> #include <errno.h>
#define PAGESIZE sysconf(_SC_PAGESIZE) #define PAGESIZE sysconf(_SC_PAGESIZE)
#define MSGSPACE_DEFAULT_MODE 0600
#define MSGSPACE_ID_LEN 32
#endif #endif

View file

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

View file

@ -55,9 +55,15 @@ int msgSpacePoolId2nzgPoolId(msgSpacePoolId dest,msgSpacePoolId src, int num){
// //donne l'adr en mappant in the memory // //donne l'adr en mappant in the memory
//poolAddr = mmap(NULL, sizeof(*msgPool), PROT_NONE, MAP_SHARED, poolFd, 0); //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; msgPool * poolAddr;
int dataId; 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; //msgSpacePoolData spoolData;
//dataId = msg->poolDataId; //dataId = msg->poolDataId;

View file

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