Sponsored Content
Full Discussion: msgrcv pending forever !!!
Top Forums Programming msgrcv pending forever !!! Post 94591 by Corona688 on Monday 2nd of January 2006 01:57:19 AM
Old 01-02-2006
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.
 

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

msgrcv : Invalid argument

Hi All, Please guide me how to get rid : msgrcv : Invalid argument. I am using message queues: msgsnd and msgrcv, I am able to send through msgsnd and receive through msgrcv, but at times i get the belo error. msgrcv : Invalid argument. (1 Reply)
Discussion started by: answers
1 Replies

2. AIX

msgrcv crash in AIX 5.3 SP6

Hi All, I have a piece of code like blow. It is working fine with AIX 5.3 SP3. When the same thing is getting executed in AIX 5. SP6 it is giving segmentation fault. If I put debug statements before and after, it works fine. rc = msgrcv(mqid, &msg, size, HIGH_PRIORITY_FIRST , 0) ... (0 Replies)
Discussion started by: sandhya_chp
0 Replies

3. IP Networking

valid_lft forever preferred_lft forever <-- what does this mean?

Just looking at my ethernet interface.. I see this response... what does this mean...? ipconfig... lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo inet6 ::1/128 scope host valid_lft... (0 Replies)
Discussion started by: jimmyc
0 Replies

4. Programming

C Posix - msgsnd() msgrcv

Hey guys, Im doing message passing for the first time on a linux OS. Im new to C programming, so bear with me. I made two .c files : central.c and external.c I simply wanted to pass a message from the central process to the external process. BUT Whenever each process gets to the... (3 Replies)
Discussion started by: carl33p
3 Replies

5. UNIX for Dummies Questions & Answers

IPC Message Queue. msgrcv doesnt work..

Hi everybody, this is the situation. there is a programm XYZ which opens a message queue with the key 47110815 and waits for a SIGUSR1. After receiving this signal it sends a message with type 100 and a number (as ASCII) in the message-body. I have to write a prog which frist sends the... (1 Reply)
Discussion started by: daredevil82m
1 Replies

6. UNIX for Dummies Questions & Answers

pending signals

I was wondering about following. If I have set of 3 signals. And they are all blocked.Now at some point in the program the set is unblocked. Which signal will be delivered first.This is my set....SIGTSTP,SIGQUIT,SIGINT.When I added them in the set and unblock them I did it in following order... ... (1 Reply)
Discussion started by: joker40
1 Replies

7. Programming

How can I tell when recv is finished with pending data?

I'm working with recv and I am having a heck of a lot of trouble ignoring excess data that I did not ask for. I was hoping someone could shine some light on the subject for me because I'm not getting anywhere fast. ---------- Post updated at 02:46 AM ---------- Previous update was at 12:31 AM... (2 Replies)
Discussion started by: Errigour
2 Replies

8. UNIX for Dummies Questions & Answers

Forever -w option

I am trying to use the forever command. I can get it to work if I do not use the w option to watch for changes and cause an automatic restart on a change to the contents of the directory being watched. I would really like to use the watch option. Is this option fully implemented? here is an... (4 Replies)
Discussion started by: barrygordon
4 Replies
alarm(2)							   System Calls 							  alarm(2)

NAME
alarm - schedule an alarm signal SYNOPSIS
#include <unistd.h> unsigned int alarm(unsigned int seconds); DESCRIPTION
The alarm() function causes the system to generate a SIGALRM signal for the process after the number of real-time seconds specified by sec- onds have elapsed (see signal.h(3HEAD)). Processor scheduling delays may prevent the process from handling the signal as soon as it is generated. If seconds is 0, a pending alarm request, if any, is cancelled. If seconds is greater than LONG_MAX/hz, seconds is rounded down to LONG_MAX/hz. The value of hz is normally 100. Alarm requests are not stacked; only one SIGALRM generation can be scheduled in this manner; if the SIGALRM signal has not yet been gen- erated, the call will result in rescheduling the time at which the SIGALRM signal will be generated. The fork(2) function clears pending alarms in the child process. A new process image created by one of the exec(2) functions inherits the time left to an alarm signal in the old process's image. RETURN VALUES
If there is a previous alarm request with time remaining, alarm() returns a non-zero value that is the number of seconds until the previous request would have generated a SIGALRM signal. Otherwise, alarm() returns 0. ERRORS
The alarm() function is always successful; no return value is reserved to indicate an error. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ |MT-Level |Async-Signal-Safe | +-----------------------------+-----------------------------+ SEE ALSO
exec(2), fork(2), signal.h(3HEAD), attributes(5), standards(5) SunOS 5.11 6 Jun 2007 alarm(2)
All times are GMT -4. The time now is 09:12 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy