custom_msg rcv and snd
This commit is contained in:
parent
b39fe5f699
commit
1f42dedc9a
|
@ -2,7 +2,7 @@
|
|||
#include <sys/msg.h>
|
||||
|
||||
void msgRcv(void *msgp, size_t size, long mtype) {
|
||||
if (msgrcv(_MSGQID, msgp, size, mtype, 0) == -1) {
|
||||
if (msgrcv(_MSGQID, msgp, size, mtype, 0) == -1) {
|
||||
errExitMsg("msgrcv");
|
||||
}
|
||||
}
|
||||
|
@ -22,6 +22,14 @@ void rcvGame_end(game_end_t *game) {
|
|||
}
|
||||
|
||||
|
||||
|
||||
void msgSnd(void *msgp, size_t size, long mtype) {
|
||||
if (msg(_MSGQID, msgp, size, mtype, 0) == -1) {
|
||||
errExitMsg("msgrcv");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void sndMsg(msg_t *msg) {
|
||||
if (msgsnd(_MSGQID, msg, sizeof(msg_t) - sizeof(long), 0) == -1) {
|
||||
errExitMsg("msgsnd");
|
||||
|
|
Loading…
Reference in New Issue