Questions tagged [msgrcv]

A system call used to receive messages from a message queue in Linux. Similarly, Msgsnd() is the respective system call used to send messages. Use this tag for questions related to the system call msgrcv()

A system call used to receive messages from a message queue in Linux. Similarly, Msgsnd() is the respective system call used to send messages. Use this tag for questions related to the system call msgrcv()

35 questions
0
votes
1 answer

Message Type is different from the one sent - msgsnd/msgrcv C

I'm studying Operative Systems basics for my exam and I've faced a strange problem. I'm currently working on send/receive function. Suppose I have 3 main program Client, which thanks to msgsnd() primitive send a message. The struct is the…
King Powa
  • 441
  • 3
  • 9
0
votes
0 answers

How to clear a message from message queue after it is read?

I was trying to create a program where the master keeps sending messages to user processes. Each time the user process receives a message it should send an acknowledgment (send a message back to master) saying it received the message and pick a…
Fairy
  • 101
  • 2
  • 12
0
votes
0 answers

Message queues message receive gives error invalid argument

Very new to message queues and I am getting an error when I send a message from pikabo.c to master.c. I initially thought there was something wrong with my msgget() but master is able to send a message to pikabo.c and pikabo is able to read it. I'm…
Fairy
  • 101
  • 2
  • 12
0
votes
1 answer

Msgrcv does not receive messages however they have been sent properly

I'm writing a basic server program which has to receive two types of messages from clients (first message is of type 1 and second is of type 2). It seems that it doesn't see messeges from clients that have been sent properly (msgsnd doesn't return…
user9717641
0
votes
1 answer

Message queue won't read message of enum type

I'm trying to use message queue to send and receive messages between father and son processes, I used enum to set message types for msgrcv but it seems that it ignores that information: enum children { e_father_child1 = 1, e_father_child2 = 2, …
user4795927
0
votes
1 answer

msgrcv() function failing in child process

I am currently trying to send messages between a master process and its child processes. I am using message passing to enforce a critical section but my message receive function in the child processes is failing and I do not know if there is a…
bkedge
  • 105
  • 1
  • 2
  • 10
0
votes
1 answer

Message receive program only printing every other message

I am have implemented the two programs from section 7.6 of http://beej.us/guide/bgipc/output/html/multipage/mq.html. I have extended it so that there are two receiving programs and which one it goes to is determined by the message type. The…
ANdr
  • 5
  • 4
0
votes
1 answer

Implementing a WatchDog timer

I need to implement a timer that checks for conditions every 35 seconds. My program is using IPC schemes to communicate information back and forth between client and server processes. The problem is that I am running msgrcv() function in a loop,…
Kyle Jensen
  • 419
  • 9
  • 27
0
votes
1 answer

Query in MSG_EXCEPT flag in message queue

Can any one tell me how to use MSG_EXCEPT flag in "msgrcv" function on message queue with example? I am trying to do it but it will give me an error like : MSG_EXCEPT undeclared I have entered all the header files for "msgrcv" function. please give…
0
votes
1 answer

Check a msqid to see if there is message without waiting or msgrcv

Thank you all for checking this. I wanted to know if there is any way to check a message queue (msqid) and see if there are any messages in the queue. If not, I would like to continue. The only way I've been able to find online is by using msgrcv,…
user1660454
  • 61
  • 1
  • 6
0
votes
2 answers

error in msgrcv() :receiving data through message queue in C

I am sending message using message queue mechanism in C linux. But there is some problem with the msgrcv function. It's showing error as invalid argument. Please check this. //msgrcv.c #include"msgbuf.h" int main() { int msqid; key_t…
user3436838
  • 113
  • 3
  • 14
0
votes
0 answers

Receiving SysV messages using fork()

I'm trying to receive a series of messages I sent with msgsnd in a series of fork()s. I can tell the messages sent ok, but receiving them has been a problem. Here's the problem part of the code, using three messages as an…
0
votes
3 answers

How are ordered the messages insinde an IPC queue

I need to known if that the messages insinde an IPC queue is orderered. In practise I need to know if when a call a msgrvc function I get the first message enetered the queue or the selected message is random. Now, I put this question because when…
enzo1959
  • 409
  • 2
  • 5
  • 13
0
votes
1 answer

IPC message queue. msgrcv system call. System V. how to get out of loop

I have a message queue from which I am getting messages in a loop. The problem is that I don't know how to exit the loop. msgrcv returns type size_t so it keeps going. What value should I compare the return value so I can exit the…
user69514
  • 26,935
  • 59
  • 154
  • 188
0
votes
2 answers

message queue. msgsend msgrcv. System V IPC system calls in C (Linux)

Hi I'm working with some shared memory where different processes read and write data. I'm using a message queue to store messages of when data has changed between read and write operations. /* struct that defines a message */ struct msgbuf{ long…
user69514
  • 26,935
  • 59
  • 154
  • 188