The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Special Forums > UNIX Desktop for Dummies Questions & Answers
Google UNIX.COM


UNIX Desktop for Dummies Questions & Answers Questions regarding GNOME, KDE, CDE, Open Office, etc go here. All UNIX and Linux Newbies Welcome !!

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-19-2008
Registered User
 

Join Date: May 2008
Posts: 8
Stumble this Post!
Unhappy mq_receive() example

can anyone provide me with a simple example of mq_receive().
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 05-19-2008
Registered User
 

Join Date: Nov 2007
Location: Pune
Posts: 19
Stumble this Post!
ssize_t mq_receive(mqd_t mqdes, char *buf, size_t len, unsigned *prio)
takes the oldest message with the highest priority from mqdes into buf. prio, if not NULL, is filled with the priority of the given message.
Returns the length of the message received, or -1 on error.
Quote:

msgsz = mq_receive(msgq_id, msgcontent, MAX_MSG_LEN, &sender);
if (msgsz == -1) {
perror("In mq_receive()");
exit(1);
}

Last edited by push; 05-19-2008 at 03:14 AM. Reason: no notes
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 04:52 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0