Jump to content

What is $sig in posix_kill()?


forumforme123

Recommended Posts

Hi,

 

I am trying to kill my process via pid with the function posix_kill.

However, I am not sure what is an int $sig for the second parameter?

I'm putting various number in it, from 0 - 3, and it still works, I think.

Coz I'm not getting any error back.

Any light on this is appreciated.

 

Thanks

Link to comment
Share on other sites

I can confirm as a linux developer, but, As it seems you're learning, lets read the documentation you linked to before you require further information:

 

pid: The process identifier.

sig: One of the PCNTL signals constants.

 

Wasn't that hard? And no, POSIX is not a PHP question (Only POSIX related structures within the languages, such as POSIX Regular expressions which are deprecated in trunk) which are part of the framework. It's the same answer you'll get when asking how to use system on a foreign command.

 

Link to comment
Share on other sites

Alright. If you're not aware of how *nix commands its processes, you can look at these:

http://en.wikipedia.org/wiki/SIGKILL

http://en.wikipedia.org/wiki/SIGTERM

 

For example SIGTERM will be constant 15, So you should use it with your POSIX command. On a linux kernel the command "top" would allow you to view processes, You can choose to kill, terminate, or deprecate a open/halted/zombie process and basically it's a just level of command. Terminating will "tell" the command to quit, killing it will force it to terminate no matter what it's doing.

 

This question is off topic, There's no need to answer further.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.