Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8357467
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T10:29:08+00:00 2026-06-09T10:29:08+00:00

I have a library which installs a signal handler for SIGSEGV for debugging purpose.

  • 0

I have a library which installs a signal handler for SIGSEGV for debugging purpose. The SIGSEGV handler just prints some information and then exits the program.

Recently, I had the need to invoke this library from Java (using JNI), and the problem I ran into is that JVM also installs a signal handler for SIGSEGV for more useful purpose than mine.

So the action what I want to choose is that in case my library finds a signal handler already installed for a signal, it simply doesn’t install any signal.

For clarity, I am using sigaction call.

Now to achieve my functionality what I have to do is:

a. BLOCK all signals.

b. call sigaction and check if oact returns a valid handler.

c. if it does, re-call sigaction with oact as new act.

d. UNBLOCK signals.

B and c seem to be cumbersome to me. What I want is to be able to just determine if a particular signal already has a handler without first replacing the handler and then re-replacing it with the original handler (achieving nothing).

Is there anything more granular than sigaction?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T10:29:09+00:00Added an answer on June 9, 2026 at 10:29 am

    You can call sigaction(SIGSEGV, NULL, &sa) to query the signal disposition without altering it.

    Note that blocking signals does not “lock out” other threads because signal masks are per thread while signal dispositions are common for all threads in a process.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a large makefile which builds several libraries, installs them, and then keeps
I have gdata library install on my ArchLinux, and a simple application which imports
I have this library called BASS which is an audio library which I'm going
I have a library which has a basic class which is used extensively by
If i have a library which is compiled in .NET 4 and reference it
I have a .dll library which exports a function in the following format: _Java_folder1_folder2_folder3_JavaClassName_javamethodname@16
I have a c-library which I use in gcc. The library has the extension
I have created a library which reads the app.config file and gets the type
I have kind of library which uses a bunch of its own perf counters.
I have to import library which is called functions.sage . How can I do

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.