| BY_OPTIMIZED | 0 | The system obtains the application usage duration statistics in the specified time frame at the interval the system deems appropriate.|
| BY_DAILY | 1 | The system obtains the application usage duration statistics in the specified time frame on a daily basis. |
| egid | number | Yes| No| Effective group identifier (EGID) of a process. This is a system API and cannot be called by third-party applications.|
| euid | number | Yes| No| Effective user identifier (EUID) of a process. This is a system API and cannot be called by third-party applications.|
| gid | number | Yes| No| Group identifier (GID) of a process. This is a system API and cannot be called by third-party applications.|
| egid | number | Yes| No| Effective group identifier (EGID) of a process.<br>**System API**: This is a system API.<br>It is used only to test applications.|
| euid | number | Yes| No| Effective user identifier (EUID) of a process.<br>**System API**: This is a system API.<br>It is used only to test applications.|
| gid | number | Yes| No| Group identifier (GID) of a process.<br>**System API**: This is a system API.<br>It is used only to test applications.|
| uid | number | Yes| No| User identifier (UID) of a process.|
| groups | number[] | Yes| No| Array with supplementary group IDs. This is a system API and cannot be called by third-party applications.|
| groups | number[] | Yes| No| Array with supplementary group IDs.<br>**System API**: This is a system API.<br>It is used only to test applications.|
| pid | number | Yes| No| Process ID (PID) of a process.|
| ppid | number | Yes| No| Parent process ID (PPID) of a process. This is a system API and cannot be called by third-party applications.|
| ppid | number | Yes| No| Parent process ID (PPID) of a process.<br>**System API**: This is a system API.<br>It is used only to test applications.|
| tid<sup>8+</sup> | number | Yes| No| Thread ID (TID) of a process.|
...
...
@@ -32,7 +32,7 @@ import process from '@ohos.process';
Provides APIs for throwing exceptions during the addition of a process.
### process.isAppUid<sup>9+</sup>
### isAppUid<sup>9+</sup>
isAppUid(v: number): boolean
...
...
@@ -60,7 +60,7 @@ let result = pro.isAppUid(688);
```
### process.getUidForName<sup>9+</sup>
### getUidForName<sup>9+</sup>
getUidForName(v: string): number
...
...
@@ -88,7 +88,7 @@ let pres = pro .getUidForName("tool");
```
### process.getThreadPriority<sup>9+</sup>
### getThreadPriority<sup>9+</sup>
getThreadPriority(v: number): number
...
...
@@ -117,7 +117,7 @@ let pres = pro.getThreadPriority(tid);
```
### process.getSystemConfig<sup>9+</sup>
### getSystemConfig<sup>9+</sup>
getSystemConfig(name: number): number
...
...
@@ -146,7 +146,7 @@ let pres = pro.getSystemConfig(_SC_ARG_MAX);
```
### process.getEnvironmentVar<sup>9+</sup>
### getEnvironmentVar<sup>9+</sup>
getEnvironmentVar(name: string): string
...
...
@@ -174,7 +174,7 @@ let pres = pro.getEnvironmentVar("PATH");
```
### process.exit<sup>9+</sup>
### exit<sup>9+</sup>
exit(code: number): void
...
...
@@ -198,7 +198,7 @@ pro.exit(0);
```
### process.kill<sup>9+</sup>
### kill<sup>9+</sup>
kill(signal: number, pid: number): boolean
...
...
@@ -238,10 +238,10 @@ Allows a process to obtain the standard input and output of its child processes,
| pid | number | Yes| No| PID of the child process. This is a system API and cannot be called by third-party applications.|
| ppid | number | Yes| No| PPID of the child process. This is a system API and cannot be called by third-party applications.|
| exitCode | number | Yes| No| Exit code of the child process. This is a system API and cannot be called by third-party applications.|
| killed | boolean | Yes| No| Whether the parent process successfully sends a signal to the child process to terminate it. This is a system API and cannot be called by third-party applications.|
| pid | number | Yes| No| PID of the child process.<br>**System API**: This is a system API.<br>It is used only to test applications.|
| ppid | number | Yes| No| PPID of the child process.<br>**System API**: This is a system API.<br>It is used only to test applications.|
| exitCode | number | Yes| No| Exit code of the child process.<br>**System API**: This is a system API.<br>It is used only to test applications.|
| killed | boolean | Yes| No| Whether the parent process successfully sends a signal to the child process to terminate it.<br>**System API**: This is a system API.<br>It is used only to test applications.|
### wait
...
...
@@ -250,7 +250,9 @@ wait(): Promise<number>
Waits until the child process ends. This method uses a promise to return the exit code of the child process.
This is a system API and cannot be called by third-party applications.
@@ -609,7 +621,7 @@ This is a system API and cannot be called by third-party applications.
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| timeout | number | No| Maximum running time (in ms) of the child process. When the running time of the child process exceeds the value of this parameter, the parent process sends a **killSignal** to the child process to terminate it. The default value is **0**.|
| killSignal | number\|string | No| Signal sent to the child process when the running time of a child process exceeds the timeout period. The default value is **SIGTERM**.|
| killSignal | number \| string | No| Signal sent to the child process when the running time of a child process exceeds the timeout period. The default value is **SIGTERM**.|
| maxBuffer | number | No| Maximum buffer size for the standard input and output of the child process. When the size is exceeded, the child process will be terminated. The default value is **1024 \* 1024**.|
| callback | AsyncCallback<Array<[HapModuleInfo](#hapmoduleinfo)>> | Yes | Callback used to return a maximum of 1000 FA usage records.|
| callback | AsyncCallback<Array<[HapModuleInfo](#hapmoduleinfo)>> | Yes | Callback used to return a maximum of **maxNum** FA usage records.|