I have 2 process sigserver and sigclient. sigserver waits for a signal to come and sigclient sends data (int+char) to sigserver.
sigserver.c
void sighand(int signo, siginfo_t *info, void *extra)
{
       void *ptr_val = info->si_value.sival_ptr;
       int int_val = info->si_value.sival_int;
       printf("Signal: %d, value: [%d] %s\n", signo, int_val, (char*)ptr_val);
}
int main()
{
        struct sigaction action;
        action.sa_flags = SA_SIGINFO;
        action.sa_sigaction = &sighand;
        if (sigaction(SIGUSR2, &action, NULL) == -1) {
                perror("sigusr: sigaction");
                return 0;
        }
        printf("Signal handler installed, waiting for signal\n");
        while(1) {sleep(2);}
        return 0;
}
sigclient.c
int main(int argc, char *argv[])
{
        union sigval value;
        int pid = atoi(argv[1]);
        value.sival_int = atoi(argv[2]);
        value.sival_ptr = (void*) strdup(argv[3]);
        if(sigqueue(pid, SIGUSR2, value) == 0) {
                printf("signal sent successfully!!\n");
        } else {
                perror("SIGSENT-ERROR:");
        }
        return 0;
}
now when I run client with below command ./client server_pid 15 teststring
server generates core dump.
My question is, how can a process read string sent by another process(not child).
 
     
    