1 Star 0 Fork 4.9K

bill / docs

forked from OpenHarmony / docs 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
kill.md 4.32 KB
一键复制 编辑 原始数据 按行查看 历史
NEEN 提交于 2021-03-12 17:59 . !197 Docs Update version 1.0.1

kill

Command Function

This command is used to send a specific signal to a specified process.

Syntax

kill [signo | -signo] [pid]

Parameter Description

Table 1 Parameters

Parameter

Description

Value Range

signo

Indicates the signal ID.

[1, 30]

pid

Indicates the process ID.

[1, MAX_INT]

NOTICE: The valid range of the signo value is [0, 64], and the recommended value range is [1, 30]. Other values in the valid range are reserved.

Usage

The signo and pid parameters are mandatory.

The pid value range varies depending on the system configuration. For example, if the maximum pid value supported by the system is 256, this value range is [1-256].

Example

  1. Query the current process list and determine the PID (7) of the process to be killed.

Figure 1 Querying PIDs

  1. Run kill 14 7 to send signal 14 (the default behavior of SIGALRM is to terminate the process) to process 7 helloworld_d (user-space). Then query the current process list. Process 7 has been terminated. The result of the kill 14 7 command is the same as that of the kill -14 7 command.

Figure 2 Command output

Output

The command output is as follows:

Figure 3 Sending a signal to a specified process

The signal is successfully sent if no error is reported.

Figure 4 Signal sending failure

The preceding figure shows a signal sending failure caused by invalid parameters. In this case, check that the signal ID and PID are valid.

1
https://gitee.com/ximeibaba/docs.git
git@gitee.com:ximeibaba/docs.git
ximeibaba
docs
docs
master

搜索帮助