* corrige un probleme dans l'edition de lien (librt)

This commit is contained in:
glenux 2004-02-17 21:53:14 +00:00
parent 23f454bbe1
commit c0f54a11cb
6 changed files with 30 additions and 31 deletions

View file

@ -7,9 +7,9 @@
#LIBS= #LIBS=
CC=gcc CC=gcc
CFLAGS=-ggdb -O2 -Wall CFLAGS=-ggdb -Wall
USER_CLASSPATH:=../bin:../lib #-O2
JFLAGS=-d ../bin -g -deprecation #LIBS=-lrt
#-verbose #-verbose
PRJNAME=Libnazgul PRJNAME=Libnazgul
GDATE := $(shell date +"-%Y-%m-%d_r%H") GDATE := $(shell date +"-%Y-%m-%d_r%H")
@ -32,5 +32,5 @@ clean:
@rm -f *.o @rm -f *.o
%.o : %.c %.o : %.c
$(CC) $(CFLAGS) $(INCLUDES) $(LIBINC) $(LIBS) -c $< -o $*.o $(CC) $(CFLAGS) -c $< $(INCLUDES) $(LIBINC) $(LIBS) -o $*.o

View file

@ -1,12 +1,8 @@
#include <unistd.h> /* POSIX et al */ #include "nzg_global.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h> /* pour O_RDWR */
#include <sys/types.h>
#include <sys/mman.h> /* shm_open */
#include "nzg_iface.h" #include "nzg_iface.h"
#include "nzg_proto.h" #include "nzg_proto.h"
#include <sys/types.h>
#include <sys/mman.h>
/* /*
* spaceId : identifiant externe de l'espace de msg * spaceId : identifiant externe de l'espace de msg
@ -57,7 +53,7 @@ msgSpace * msgSpaceOpen(msgSpaceId spaceId){
} }
void msgSpaceDelete(msgSpaceId spaceId){ void msgSpaceDelete(msgSpaceId spaceId){
int shmId; //int shmId;
msgSpaceId nzgId=msgSp2nzgId(spaceId); msgSpaceId nzgId=msgSp2nzgId(spaceId);
int er; int er;
if ((er=shm_unlink(nzgId))<0){ if ((er=shm_unlink(nzgId))<0){

View file

@ -1,3 +1,9 @@
#include <unistd.h> #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> /* shm_open */
#define PAGESIZE sysconf(_SC_PAGESIZE) #define PAGESIZE sysconf(_SC_PAGESIZE)

View file

@ -1,13 +1,6 @@
char **msgSpaceIdList(void); char **msgSpaceIdList(void);
msgSpace * msgSpaceCreate(
msgSpaceId spaceId, // identifiant externe de l'espace de msg
int queueNb, // nombre de files de messages
int poolNb, // nombre de pool de buffers
msgPool * queueNbCar // tableau de caracteristiques des different pool
);
void * msgAllocate( void * msgAllocate(
msgSpace * space, //espace de message concerné msgSpace * space, //espace de message concerné
int pool, //numéro de pool ou réaliser l'allocation int pool, //numéro de pool ou réaliser l'allocation
@ -17,7 +10,10 @@ void * msgAllocate(
/* nzg_create.c */ /* nzg_create.c */
msgSpace *msgSpaceCreate(msgSpaceId spaceId, int queueNb, int poolNb, msgPool *queueNbCar); msgSpace *msgSpaceCreate(
msgSpaceId spaceId, int queueNb, int poolNb, msgPool *queueNbCar
);
msgSpace *msgSpaceOpen(msgSpaceId spaceId); msgSpace *msgSpaceOpen(msgSpaceId spaceId);
void msgSpaceDelete(msgSpaceId spaceId); void msgSpaceDelete(msgSpaceId spaceId);
msgSpaceId msgSp2nzgId(msgSpaceId spaceId); msgSpaceId msgSp2nzgId(msgSpaceId spaceId);

View file

@ -7,19 +7,16 @@
#LIBS= #LIBS=
CC=gcc CC=gcc
CFLAGS=-ggdb -O2 -Wall CFLAGS=-Wall --static
INCLUDES=-I../src #-O2 -ggdb
LIBINC=-L../src INCLUDES=-I ../src/
LIBS=-lnazgul LIBINC=-L ../src
LIBS=-lnazgul -lrt
USER_CLASSPATH:=../bin:../lib
JFLAGS=-d ../bin -g -deprecation
#-verbose
PRJNAME=Libnazgul PRJNAME=Libnazgul
GDATE := $(shell date +"-%Y-%m-%d_r%H") GDATE := $(shell date +"-%Y-%m-%d_r%H")
GFILENAME := ../$(PRJNAME)$(GDATE).tar.bz2 GFILENAME := ../$(PRJNAME)$(GDATE).tar.bz2
LOCALDIR = $(shell pwd) LOCALDIR = $(shell pwd)
BINDIR=../bin
CFILES := $(shell ls *.c) CFILES := $(shell ls *.c)
#OFILES := $(patsubst %.c,%.o,$(CFILES)) #OFILES := $(patsubst %.c,%.o,$(CFILES))
FILES := $(patsubst %.c,%,$(CFILES)) FILES := $(patsubst %.c,%,$(CFILES))
@ -35,5 +32,5 @@ clean:
@rm -f $(FILES) @rm -f $(FILES)
% : %.c % : %.c
$(CC) $(CFLAGS) $(INCLUDES) $(LIBINC) $(LIBS) $< -o $* $(CC) $(CFLAGS) $< -o $* $(INCLUDES) $(LIBINC) $(LIBS)

View file

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