Table of Contents

Method kill

Namespace
Alternet.UI
Assembly
Alternet.UI.Common.dll

kill(int, int)

Sends a signal to a process or a group of processes.

public static extern int kill(int pid, int sig)

Parameters

pid int

The process ID or process group ID to which the signal is sent. If positive, the signal is sent to the process with the specified ID. If zero, the signal is sent to all processes in the caller's process group. If negative, the signal is sent to all processes in the process group with the absolute value of pid.

sig int

The signal to be sent. This is typically one of the signal constants defined in the operating system.

Returns

int

Returns 0 on success. On failure, returns -1 and sets the last error, which can be retrieved.

Remarks

This method is a direct wrapper for the POSIX kill function. It is used to send signals to processes for purposes such as termination or custom signal handling.