httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ricardo13 <ricardoogra...@gmail.com>
Subject APR, Shared Memory and extern process
Date Tue, 18 Nov 2008 19:17:26 GMT

Hi,

I'm writing a apache's module that comunicate with a extern process.

My extern process is built in C:

        char*  shm_address;
	int    shmid;
	key_t  shmkey;

	shmkey = 5678;
    	shmid = shmget(shmkey, SIZEOFSHMSEG, 0666);
    	if (shmid == -1)
        	printf("main: shmget() failed\n");
      
    	shm_address = shmat(shmid, NULL, 0);
    	if ( shm_address==NULL )
        	printf("main: shmat() failed\n");        

	while(1) {
		if(strcmp(shm_address, ":") == 0) {
			strcpy(shm_address, data);
			break;
		}
	}

    	int rc = shmdt(shm_address);
    	if (rc==-1)
        	printf("main: shmdt() failed\n");


Now I want to write a module that take (or get) the information in this
segment.
Can someone help me ??

Thank You

Ricardo 

-- 
View this message in context: http://www.nabble.com/APR%2C-Shared-Memory-and-extern-process-tp20566322p20566322.html
Sent from the Apache HTTP Server - Module Writers mailing list archive at Nabble.com.


Mime
View raw message