Sponsored Content
Top Forums Programming gnu history library signal segfault Post 101716 by a1g0rithm on Sunday 12th of March 2006 03:13:20 AM
Old 03-12-2006
gnu history library signal segfault [solved]

i am trying to use the history functions in a c++ program along with a custom signal handler for SIGINT.

the prog works fine catching signals without the line:

add_history(*args);

but as soon as this line is added, the prog segfaults on SIGINT.

does anyone have experience using gnu history with custom signal handlers?

[solved]

the add_history function did not work well with the *args pointer.. it would complile and execute once fine, but segfault.. fixed by assigning *args contents to buffer var and passing this in to add_history.

Last edited by a1g0rithm; 03-12-2006 at 04:35 AM..
 

3 More Discussions You Might Find Interesting

1. Linux

Installing GNU C library

I m working on a project of making a boot/root pendrive linux from source. I have got the basic working root filesystem with busybox. Now i wish to install GNU C library. But couldnt find a proper document to refer to. Also i tried the steps in LFS with just specifying the installation directory... (2 Replies)
Discussion started by: amu
2 Replies

2. Linux

Plz Help me to find GNU C++ Runtime Library

Hi, I am working with red hat Linux and i want to install one program but I am getting the error This product requires the GNU C++ Runtime Library (libstdc++-libc6.2-2.so.3) or later. Your system must be upgraded before installation can proceed. So please tell me how can i remove this... (2 Replies)
Discussion started by: smartgupta
2 Replies

3. Programming

GNU C library for parsing of XML files

Hi all, Is there a known GNU C library available for parsing XML files for particular attributes ? (1 Reply)
Discussion started by: vsanjit
1 Replies
sigsuspend(2)							   System Calls 						     sigsuspend(2)

NAME
sigsuspend - install a signal mask and suspend caller until signal SYNOPSIS
#include <signal.h> int sigsuspend(const sigset_t *set); DESCRIPTION
The sigsuspend() function replaces the caller's signal mask with the set of signals pointed to by the set argument and suspends the caller until delivery of a signal whose action is either to execute a signal catching function or to terminate the process. If the set argument points to an invalid address, the behavior is undefined and errno may be set to EFAULT. If the action is to terminate the process, sigsuspend() does not return. If the action is to execute a signal catching function, sigsus- pend() returns after the signal catching function returns. On return, the signal mask is restored to the set that existed before the call to sigsuspend(). It is not possible to block signals that cannot be ignored (see signal.h(3HEAD)). This restriction is silently imposed by the system. RETURN VALUES
Since sigsuspend() suspends the caller's execution indefinitely, there is no successful completion return value. On failure, it returns -1 and sets errno to indicate the error. ERRORS
The sigsuspend() function will fail if: EINTR A signal was caught by the caller and control was returned from the signal catching function. The sigsuspend() function may fail if: EFAULT The set argument points to an illegal address. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ |MT-Level |Async-Signal-Safe | +-----------------------------+-----------------------------+ SEE ALSO
sigaction(2), sigprocmask(2), sigwait(2), signal(3C), signal.h(3HEAD), sigsetops(3C), attributes(5) NOTES
If the caller specifies more than one unblocked signal in the mask to sigsuspend(), more than one signal might be processed before the call to sigsuspend() returns. While the caller is executing the signal handler that interrupted its call to sigsuspend(), its signal mask is the one passed to sigsus- pend(), modified as usual by the signal mask specification in the signal's sigaction(2) parameters. The caller's signal mask is not restored to its previous value until the caller returns from all the signal handlers that interrupted sigsuspend(). SunOS 5.11 24 Jun 2001 sigsuspend(2)
All times are GMT -4. The time now is 04:47 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy