12-07-2011
The general way to deal with this is: don't. In your signal handler, do as little work as possible - i.e. set/increment a flag to let your program know the signal has been caught, and do the work from the main body of the code.
In the case of incrementing a flag, you might want to have a look at __sync_fetch_and_add() and such in the gcc documentation - do a search for "gcc atomic builtins".
3 More Discussions You Might Find Interesting
1. Programming
Hi All,
Rather than re-invent the wheel, I am trying to find a mature C library that provides generic support for lists, trees, etc.
I understand C doesn't formally support "generics", but am aware of a few solutions like GLib and SGLib.
Can anyone kindly recommend what they think is best?... (1 Reply)
Discussion started by: tristan12
1 Replies
2. Programming
Hello,
I wonder if I can write my userdefined data structures(ex: a list) to a shared memory segment?
I know, the shm functions get (void*) parameter so I should be able to read and write a list into the shared memory.
may someone inform and clarify me about that, please? (1 Reply)
Discussion started by: xyzt
1 Replies
3. Shell Programming and Scripting
Here is what i need to do.
@data #has all column wise data so say info for col 1 location for all rows would be in this array
$array = \@data
But i need to create a file which should contain these information in a format for all columns even if i have got no values from some of the index... (0 Replies)
Discussion started by: dinjo_jo
0 Replies
abort(3C) abort(3C)
NAME
abort() - generate a software abort fault
SYNOPSIS
DESCRIPTION
first closes all open files, streams, directory streams, and message catalogue descriptors, if possible, then causes the signal to be sent
to the calling process. This may cause a core dump to be generated (see signal(2)).
If the signal is caught, the handling function is executed. If the handling function returns, the action for is then reset to and the sig-
nal is sent again to the process to ensure that it terminates.
RETURN VALUE
does not return.
ERRORS
No errors are defined.
APPLICATION USAGE
is not intended to be caught.
DIAGNOSTICS
If is neither caught nor ignored, and the current directory is writable, a core dump is produced and the message is written by the shell.
SEE ALSO
adb(1), exit(2), kill(2), signal(2), signal(5), thread_safety(5).
STANDARDS CONFORMANCE
abort(3C)