1

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

Billal Begueradj
  • 20,717
  • 43
  • 112
  • 130
yakana
  • 41
  • 5

1 Answers1

1

OK... my fault. For everyone who encounters the same problem:

msg.id = 1;

The id must be greater than 0.

yakana
  • 41
  • 5