With the following code:
#define MSGLEN 128
typedef struct {
long id;
char message[MSGLEN];
} data;
data msg;
msgsnd(msg_id, &msg, MSGLEN, IPC_NOWAIT);
I get an Invalid argument error, but
msgsnd(msg_id, &msg.message, MSGLEN, IPC_NOWAIT);
is working.
Of course I created the message que with msgget
and kernel.msgmax = 65536
OK... my fault. For everyone who encounters the same problem:
The id must be greater than 0.