![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| msgrcv crash in AIX 5.3 SP6 | sandhya_chp | AIX | 0 | 06-02-2008 11:54 PM |
| msgrcv : Invalid argument | answers | UNIX for Dummies Questions & Answers | 1 | 02-08-2008 06:31 AM |
| how can i make sar command run forever ? | umen | UNIX for Dummies Questions & Answers | 5 | 01-30-2008 05:23 AM |
| user password forever | xramm | SUN Solaris | 5 | 08-29-2007 01:26 AM |
| AIX 4.3.3 takes forever to log in | Jwoollard | AIX | 3 | 03-14-2005 03:56 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
When I am using msgrcv to get a message from a queue, in case of msgsnd some error, the msgrcv thread will waiting forever.
Is there some way that I can specify a time out value for this queue ? just let msgrcv wait for some time, if no message comes during this time slot, msgrcv just return failure. Is there any one know that? Thank you very much. |
| Forum Sponsor | ||
|
|
|
|||
|
Checking it's manpage, I see one possible return value for it being 'EINTR -- while the process was sleeping to recieve a message, the process caught a signal.' So alarm() might be useful, if it'll cause it to return EINTR instead of killing the process.
|
|
||||
|
I believe that the OP is looking to return from the msgrcv call if there is no message on the queue. Check the man page of msgrcv here.
Quote:
|
|
|||
|
use thread
Hi, Create a thread to receive (msgrcv) the response.
Wait for certain time (letus say 5sec). Send a reply (msgsnd) if and only if a flag is set to Success within this thread, after that much wait time. Hav a gud time. |
|||
| Google The UNIX and Linux Forums |