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 7029307
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:31:18+00:00 2026-05-28T00:31:18+00:00

I am using kill function to kill a process. However, its returning -1 and

  • 0

I am using kill function to kill a process. However, its returning -1 and perror shows “Invalid argument”. Reading the manual of kill, it says this error occurs if wrong signal value is provided. I am passing -9 or SIGKILL, like this kill( SIGKILL, pid ).

Then why is it giving invalid argument error. Note that the process who is calling the kill function is the child of the process that we are trying to kill.

  • 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-28T00:31:18+00:00Added an answer on May 28, 2026 at 12:31 am

    kill takes its arguments the other way around. From the man page:

    int kill(pid_t pid, int sig);
    

    Since you’re passing the PID in place of the signal number and vice-versa, it’s pretty likely that at least one of them will be an invalid argument as perror is telling you.

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

Sidebar

Related Questions

In C# i using process.Kill() kill a process, at the same time in killed
I know how to send signals to child process in C using the kill(pid_t
I am using the thread.Abort method to kill the thread, but it not working.
What is the best way to capture a kill signal in java without using
I'm creating a indicator applet using Python (pygtk) and I have a function that
I know, that by its very definition, a fatal exception is supposed to kill
I am using PHP SQL Server driver - is there a way to kill
I am using pcntl_fork to start a child process to send an email via
I encounter a strange issue when closing a PyGTK application. This is the function
I'm trying to implement a checkpoint function to checkpoint a process. I do it

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.