how kernel handles sharedmemory

From: Blesson Paul (
Date: Fri Jul 06 2001 - 03:16:46 EST

                  I am surprised how kernel handles the shared memory. When I
give issues shmget command, a sharedmemory is created and id is returned. then
I can use that sharememory by assigning to a charector array.
                       Now in my situation, presently there is a two
dimensional array. I want to put the whole array in the shared memory. This is
because I need to share this array between the processes. So what I done is ,
I created a linklistin sharememory. But it is not working. I am giving a
sample program. Will anyone can

#include <sys/shm.h>
typedef struct Alligned
        int count1;
        int count2;
        int count3;

char* share_alloc(int size);
Alligned_pair **m_alligned_pair;

int main()
        int shmid,count,childpids[1000],pid;
        Alligned_pair *s,**q;
                if (pid==0)

        for(count = 0; count<20; count++)
                  printf("%d %d\n",m_alligned_pair[count],
        return 1;

char* share_alloc(int size)
        int shmid;
        char *SArray;
        return SArray;
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Sat Jul 07 2001 - 21:00:17 EST