Feb 25, 2013, 3:24 PM
Post #2 of 3
Having never seen that issue before, my best guess would that it has to do with IPC::ShareLite.
Doing a simple test with IPC::SysV, simply because I've used it before.
use IPC::SysV qw(IPC_CREAT IPC_RMID);
my $key = 12345;
my $size = 80;
my $message = "9876";
my $id = shmget($key, $size, &IPC_CREAT | 0666) or
die "Can't shmget: $!";
shmwrite( $id, $message, 0, $size ) or die "Can't shmwrite: $!";
system("./cb $key $size ");
shmctl( $id, &IPC_RMID, 0 ) or die "Can't shmctl: $! ";
To save space I'm just pasting a editing down main function. Will still work, just no checks.
int main(int argc, char *argv)
int shmid, count=0;
// connect to the shared memory
shmid = shmget(key,msize ,0666);
shm = shmat(shmid, (void *)0, 0);
printf("Trying to send data\n");
Trying to send data