1834208 Members
2545 Online
110066 Solutions
New Discussion

msgsnd usage

 
Amith_2
Frequent Advisor

msgsnd usage

The msgsnd system call takes the msgid , msg buffer, msg size , msg type and msg flag as the parameters. Here specifying the value of msg flag to "0" means it waits for the system resource. What resources does this command expect? Is it the message queue size to be increase. Please tell me the relevant kernel parameter that has to set since my program waits undefinately at this setting.
1 REPLY 1
Bharat Katkar
Honored Contributor

Re: msgsnd usage

Hi Amith,
This is what man msgsnd says:

"msgflg specifies the action to be taken if a message of the desired
type is not on the queue. These are as follows:

If (msgflg & IPC_NOWAIT) is true, the calling process returns
immediately with a value of -1 and errno set to [ENOMSG].

If (msgflg & IPC_NOWAIT) is false, the calling process suspends
execution until one of the following occurs:

+ A message of the desired type is placed on the queue.

+ msqid is removed from the system. When this occurs, errno
is set to [EIDRM] and a value of -1 is returned.

+ The calling process receives a signal that is to be caught.
In this case, a message is not received and the calling
process resumes execution in the manner prescribed in
signal(5)). "

Hope that addresses your issue.
Regards,
You need to know a lot to actually know how little you know