Hey everyone! I´ve been tying to create a shared memory segment with the size of a structure, as follows:
typedef struct{
int id;
char message[1024];
}data;
In the line where i create the shared memory segment,
if((shmid = shmget(key, sizeof(data), 0766 | IPC_CREAT)) < 0){
perror("Error shmget!\n");
exit(1);
}
i get the error: 'shared memory: "Invalid Argument"'. I´m using Linux SUSE and i´ve also tried to put into the shared memory int arrays of ten elements or less, arrays of ten chars, for example, and no matter the small the array is, wether is of ints or chars, i get always that error. Does somebody could give me a hint?
Thanks for the attention, regards