*** empty log message ***

This commit is contained in:
glenux 2004-02-17 16:38:08 +00:00
parent 65c52bac68
commit 5ade666533
6 changed files with 35 additions and 19 deletions

View file

@ -1,4 +1,10 @@
#include <unistd.h> /* POSIX et al */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h> /* pour O_RDWR */
#include <sys/types.h>
#include <sys/mman.h>
#include "nzg_iface.h"
#include "nzg_proto.h"
@ -16,7 +22,20 @@ msgSpace * msgSpaceCreate(
msgPool * queueNbCar // tableau de caracteristiques des different pool
){
printf("PAGESIZE : %d\n",(int)PAGESIZE);
// on créee
char * nzgId;
int slen;
int shmId;
slen=strlen(spaceId);
nzgId = (char *)malloc(sizeof(char)*(slen+4));
sprintf(nzgId,"/NZG%s",spaceId);
if ((shmId=shm_open(nzgId,O_RDWR,MSGSPACE_DEFAULT_MODE)) < 0){
perror("shm_open");
return NULL;
}
// on ajoute spaceId a la liste des msgSpace connus
// on crée queueNb files de messages
@ -32,7 +51,17 @@ msgSpace * msgSpaceCreate(
}
void msgSpaceOpen(msgSpaceId){
msgSpace * msgSpaceOpen(msgSpaceId spaceId){
char * nzgId;
int slen;
int shmId;
slen=strlen(spaceId);
nzgId = (char *)malloc(sizeof(char)*(slen+4));
sprintf(nzgId,"/NZG%s",spaceId);
if ((shmId=shm_open(nzgId,O_RDWR,MSGSPACE_DEFAULT_MODE)) < 0){
perror("shm_open");
return NULL;
}
return NULL;
}

3
src/nzg_global.h Normal file
View file

@ -0,0 +1,3 @@
#include <unistd.h>
#define PAGESIZE sysconf(_SC_PAGESIZE)

View file

@ -1,4 +1,5 @@
#include "types.h"
#include "nzg_global.h"
#define MSGSPACE_DEFAULT_MODE 0600
typedef char * msgSpaceId;

View file

@ -1,8 +0,0 @@
#include "nzg_iface.h"
#include "nzg_proto.h"
int main(void) {
// msgSpaceId mSID=msgSpaceIdGet(""); //renvoie un ID propre au programme
// msgSpace mS=0;
return 0;
}

View file

@ -1,9 +0,0 @@
#include "nzg_iface.h"
#include "nzg_proto.h"
int main(void) {
//show existing MsgSpaces
char ** msID=msgSpaceIdList(); //renvoie un msgSpaceId
msID=msID;
return 0;
}

View file