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

  • SEARCH
  • Home
  • 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 7630939
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T06:13:32+00:00 2026-05-31T06:13:32+00:00

I have a program that I need to use signals and handlers with. I

  • 0

I have a program that I need to use signals and handlers with. I have two child processes that are supposed to receive a user defined signal and one is supposed to do nothing with the signal, while the other is supposed to print out some generic message, sleep and then print out another message indicating that the halt is over. The one child process that’s supposed to do nothing with the signal is supposed to be the one to raise the signal.

I am pretty sure the signal is rose with the notation signal(SIGINT, handler); so I would simply put that within the function that is defined by the one child process, but how do I “send” the signal to both processes? How can I say under a set of conditions that the one process receives the signal and does what it is told by the handler while the other receives the signal and does nothing?

I was reading about how kill(pid, handler) would be able to send the designated process to the handler, but whenever I try it, it tells me that argument 1 of kill makes integer from pointer without a cast.

My program is a reader/writer program that pretty much tests concepts without a definite purpose, and right now, is all within one source doc, but will be split off into a reader source to define the reader process’ functions, a writer source, which will define the writer process’ function and then the main source that creates the two child processes. I will also have a header file that will define all the necessary constants and function prototypes, but right now, if I can just get it working from within this one source, I can figure out later how to separate it into multiple sources.

  • 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-05-31T06:13:34+00:00Added an answer on May 31, 2026 at 6:13 am

    This answer is based off of my reading of the GNU C Manual’s chapter on signals.

    Like Kerrek says, signal() allows processes to register with the OS that there is a signal of interest that the process would like the OS to deliver to it. Once the signal has been generated, the sighandler_t argument to signal() specifies what the process will do, either default handling (SIG_DFL), ignore the signal (SIG_IGN), or something custom as defined by the handler function that is passed to signal(). That handler function is where you define the behaviors of one process to do something with it when the signal is delivered to it.

    The second processes job is to raise the specified signal after a period of sleep() so it’ll be using the kill(pid, signum) function to do so which takes the PID of the intended recipient and signal to deliver to said recipient.

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

Sidebar

Related Questions

I have the need to use a Stack-like data structure for a program that
I have a program that I use to change user passwords for exchange 365.
I have a program that I need to be able to search a file
I have a legacy program that I need to run with the extension of
I have a program that is written in Ada, and I need to compile
I have a program that looks like this. I need to consistently write something
I have a robot that I need to write an autonomous program for. The
I need to make the program which have one form that contains PNG image
I need an XML-serializable dictionary. Actually, I now have two quite different programs that
I have a program that needs to use sleep. Like really needs to. In

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.