I have two processes, which have these lines:
msgp.mtype := 1;
e := msgsnd(msqid, @msgp, 4, IPC_NOWAIT);
and
sz := msgrcv(msqid, @msgp, 4, 1, IPC_NOWAIT);
The variable
msgp is the type of
type mymsg1 = record
mtype: longword;
mtext: array[0..7] of byte;
end;
Now,
msgsnd() always reports no problems, that the buffer is sent. However,
msgrcv() always gives back
-1 with
errno of
ESysENOMSG,
except if the first four byte of
msgp.mtext are zeros. Then it succeeds, else it fails. Regardless the size of the sent buffer.
The very same algorithm and code works flawlessly with C. Any ideas?