4

[c]how to send an integer via message queue?

view full story
linux-howto

http://www.unix.com – how can i send an integer via message queue? i try this, but it doesn't work, child process receive 13345943 instead of 5 Code: #include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include <sys/msg.h> #include <sys/ipc.h> #include <sys/sem.h> #include <errno.h> #include <unistd.h> #include <wait.h> #include <mqueue.h> #define SEMPERM 0600 typedef union _semun {     int val;     struct semid_ds *buf;     unsigned short *array; }semun; int initsem (key_t semkey){   & (HowTos)