Sponsored Content
Top Forums Programming Runaway SIGALRM signal handler Post 302184188 by Perderabo on Thursday 10th of April 2008 11:12:16 PM
Old 04-11-2008
You are doing something extremely non-standard and you aren't bothering to test the return codes. Solaris does not support O_ASYNC. Here is the Solaris 9 fcntl man page. I don't see any O_ASYNC flag mentioned. You actually got this to compile on Solaris??? I got to try that tomorrow.... I would expect it to run on FreeBSD. I'm not sure about Linux.... I'm don't have time right now to look up the man pages. Anyway this BSD async stuff is pretty much BSD only and not part of Posix.

Please test those return codes. If not all the time, at least break down and test them when you don't understand the behavior of the system calls.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

shell script signal handler

AIX 4.3.3 I am trying to write a signal handler into a ksh shell script. I would like to capture the SIGTERM, SIGINT, and the SIGTSTP signals, print out a message to the terminal, and continue executing the script. I have found a way to block the signals: #! /bin/ksh SIGTERM=15 SIGINT=2... (2 Replies)
Discussion started by: jalburger
2 Replies

2. Programming

signal handler for SIGCHLD

Hi, I have an c++ application which uses the function fork and execvp(). The parent does not wait until the child ends. The parents just creates children and let them do their stuff. You can see the parent program as a batch-manager. I have added a SIGCHLD handler to the program: void... (3 Replies)
Discussion started by: jens
3 Replies

3. Programming

signal handler problems

Hey guys, I am trying to write a little shell, and was writing a signal handler to handle SIGINT (I am using 'stty intr ^C' and using ctrl-C to give SIGINT). I wrote this signal handler: void handle_sigint() { write(2,"handling sigint\n",16); write(1,"\nshell% ",8); } ... (4 Replies)
Discussion started by: blowtorch
4 Replies

4. Programming

Usage of exit() inside a signal handler

Is it ok to use exit() inside a signal handler? I catch SIGUSR1 in a signal handler and I try to close a file and then exit. The result is inconsistent. Sometimes the process exit and sometimes it returns to the original state before the signal handler was invoked. Perhaps exit is not legal in... (8 Replies)
Discussion started by: Tuvia
8 Replies

5. Programming

Problem with signal handler and interrupted system call

Hi, I have a daq program that runs in an infinite loop until it receives SIGINT. A handler catches the signal and sets a flag to stop the while loop. After the loop some things have to be cleaned up. The problem is that I want my main while loop to wait until the next full second begins, to... (2 Replies)
Discussion started by: soeckel
2 Replies

6. Shell Programming and Scripting

Perl - Problems with Signal Handler

I have a problem with signal handlers not working. I have a long 1000 line code and somehow this code for signal handling is not working: $SIG{INT} = \&interrupt; sub interrupt { print STDERR "Caught a control c!\n"; exit; # or just about anything else you'd want to do } Any... (2 Replies)
Discussion started by: som.nitk
2 Replies

7. Programming

Signal Handler Hangs

Hi, I have a problem with signal handler algorithm in linux. My code is hanging ( It is continuously looping inside the signal handler) . I am pasting my code here... Please provide me some help regarding this. I googled many places and wrote this code.. but doesnt seem to be working without... (6 Replies)
Discussion started by: sree_ec
6 Replies

8. Shell Programming and Scripting

Perl Signal Handler

I was working on some Perl code that does signal handling and I came across this one liner and wasn't sure what it was doing. local $SIG{__DIE__} = sub {$! = 2; die $_;}; I think the first part of the anonymous subroutine is setting $! to 2, but I am not sure what the second part is doing. ... (1 Reply)
Discussion started by: SFNYC
1 Replies

9. Programming

problem in doing coding of signal handler

i m unble to execute code of signal handler using a) Wait b) Waitpid (1 Reply)
Discussion started by: madhura
1 Replies

10. Programming

Serial port signal(IRQ) handler (using C)

Hello, I'm writing some serial(UART) handler but have stuck on few issues, maybe anyone can help to show me what I'm doing wrong. Basically I'm intending to write serial RX signal handler. Application receives defined packages of data over serial which contains header and payload. Handler... (3 Replies)
Discussion started by: Lauris_k
3 Replies
INTRO(3)						     Linux Programmer's Manual							  INTRO(3)

NAME
intro - introduction to library functions DESCRIPTION
Section 3 of the manual describes all library functions excluding the library functions (system call wrappers) described in section 2, which implement system calls. Many of the functions described in the section are part of the Standard C Library (libc). Some functions are part of other libraries (e.g., the math library, libm, or the real-time library, librt) in which case the manual page will indicate the linker option needed to link against the required library (e.g., -lm and -lrt, respectively, for the aforementioned libraries). In some cases, the programmer must define a feature test macro in order to obtain the declaration of a function from the header file speci- fied in the man page SYNOPSIS section. (Where required, these feature test macros must be defined before including any header files.) In such cases, the required macro is described in the man page. For further information on feature test macros, see feature_test_macros(7). CONFORMING TO
Certain terms and abbreviations are used to indicate UNIX variants and standards to which calls in this section conform. See standards(7). NOTES
Authors and copyright conditions Look at the header of the manual page source for the author(s) and copyright conditions. Note that these can be different from page to page! SEE ALSO
intro(2), errno(3), capabilities(7), credentials(7), environ(7), feature_test_macros(7), libc(7), math_error(7), path_resolution(7), pthreads(7), signal(7), standards(7) COLOPHON
This page is part of release 3.53 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. Linux 2010-11-11 INTRO(3)
All times are GMT -4. The time now is 12:45 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy