Sponsored Content
Full Discussion: Signalsafe data structures
Top Forums Programming Signalsafe data structures Post 302579931 by JohnGraham on Wednesday 7th of December 2011 04:17:17 AM
Old 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

Recommendations For Generic C Data Structures & Algorithms

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

shared memory - userdefined data structures

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

Perl Data Structures

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(3)						     Linux Programmer's Manual							  ABORT(3)

NAME
abort - cause abnormal process termination SYNOPSIS
#include <stdlib.h> void abort(void); DESCRIPTION
The abort() first unblocks the SIGABRT signal, and then raises that signal for the calling process. This results in the abnormal termina- tion of the process unless the SIGABRT signal is caught and the signal handler does not return (see longjmp(3)). If the abort() function causes process termination, all open streams are closed and flushed. If the SIGABRT signal is ignored, or caught by a handler that returns, the abort() function will still terminate the process. It does this by restoring the default disposition for SIGABRT and then raising the signal for a second time. RETURN VALUE
The abort() function never returns. CONFORMING TO
SVr4, POSIX.1-2001, 4.3BSD, C89, C99. SEE ALSO
gdb(1), sigaction(2), exit(3), longjmp(3), raise(3) COLOPHON
This page is part of release 3.25 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/. GNU
2007-12-15 ABORT(3)
All times are GMT -4. The time now is 08:36 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy