1e41f4b71Sopenharmony_ci# ChildProcess 2e41f4b71Sopenharmony_ci 3e41f4b71Sopenharmony_ci 4e41f4b71Sopenharmony_ci## Overview 5e41f4b71Sopenharmony_ci 6e41f4b71Sopenharmony_ciThe ChildProcess module provides APIs to manage child processes. You can call the APIs to create a native child process and establish an IPC channel between the parent and child processes to implement multi-process application development. 7e41f4b71Sopenharmony_ci 8e41f4b71Sopenharmony_ciThe created child process does not support the UI or the calling of context-related APIs. A maximum of 512 child processes can be started through this module and [childProcessManager](js-apis-app-ability-childProcessManager.md) (non-SELF_FORK mode). 9e41f4b71Sopenharmony_ci 10e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Ability.AbilityRuntime.Core 11e41f4b71Sopenharmony_ci 12e41f4b71Sopenharmony_ci**Since**: 12 13e41f4b71Sopenharmony_ci 14e41f4b71Sopenharmony_ci 15e41f4b71Sopenharmony_ci## Summary 16e41f4b71Sopenharmony_ci 17e41f4b71Sopenharmony_ci 18e41f4b71Sopenharmony_ci### Files 19e41f4b71Sopenharmony_ci 20e41f4b71Sopenharmony_ci| Name | Description | 21e41f4b71Sopenharmony_ci| ------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | 22e41f4b71Sopenharmony_ci| [native_child_process.h](native__child__process_8h.md) | Declares the APIs used to create a native child process and establish an IPC channel between the parent and child processes.<br>File to include: <AbilityKit/native_child_process.h><br>Library: libchild_process.so<br>| 23e41f4b71Sopenharmony_ci 24e41f4b71Sopenharmony_ci### Types 25e41f4b71Sopenharmony_ci 26e41f4b71Sopenharmony_ci| Name | Description | 27e41f4b71Sopenharmony_ci| ------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------- | 28e41f4b71Sopenharmony_ci| typedef enum Ability_NativeChildProcess_ErrCode [Ability_NativeChildProcess_ErrCode](#ability_nativechildprocess_errcode) | Defines an enum for the error codes used by the native child process module.| 29e41f4b71Sopenharmony_ci| typedef void(\* [OH_Ability_OnNativeChildProcessStarted](#oh_ability_onnativechildprocessstarted)) (int errCode, OHIPCRemoteProxy \*remoteProxy) | Defines a callback function for notifying the child process startup result.| 30e41f4b71Sopenharmony_ci| typedef struct [NativeChildProcess_Fd](#nativechildprocess_fdlist) | Defines a struct for the file descriptor of a child process.| 31e41f4b71Sopenharmony_ci| typedef struct [NativeChildProcess_FdList](#nativechildprocess_fdlist) | Defines a struct for the linked list of file descriptors of a child process.| 32e41f4b71Sopenharmony_ci| typedef struct [NativeChildProcess_Args](#nativechildprocess_args) | Defines a struct for the arguments used for starting a child process.| 33e41f4b71Sopenharmony_ci 34e41f4b71Sopenharmony_ci 35e41f4b71Sopenharmony_ci### Enums 36e41f4b71Sopenharmony_ci 37e41f4b71Sopenharmony_ci| Name | Description | 38e41f4b71Sopenharmony_ci| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------- | 39e41f4b71Sopenharmony_ci| [Ability_NativeChildProcess_ErrCode](#ability_nativechildprocess_errcode) {<br> NCP_NO_ERROR = 0,<br> NCP_ERR_INVALID_PARAM = 401,<br> NCP_ERR_NOT_SUPPORTED = 801,<br> NCP_ERR_INTERNAL = 16000050,<br> NCP_ERR_BUSY = 16010001,<br> NCP_ERR_TIMEOUT = 16010002,<br> NCP_ERR_SERVICE_ERROR = 16010003,<br> NCP_ERR_MULTI_PROCESS_DISABLED = 16010004,<br> NCP_ERR_ALREADY_IN_CHILD = 16010005,<br> NCP_ERR_MAX_CHILD_PROCESSES_REACHED = 16010006,<br> NCP_ERR_LIB_LOADING_FAILED = 16010007,<br> NCP_ERR_CONNECTION_FAILED = 16010008<br>} | Enumerates the error codes used by the native child process module.| 40e41f4b71Sopenharmony_ci 41e41f4b71Sopenharmony_ci 42e41f4b71Sopenharmony_ci### Functions 43e41f4b71Sopenharmony_ci 44e41f4b71Sopenharmony_ci| Name | Description | 45e41f4b71Sopenharmony_ci| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | 46e41f4b71Sopenharmony_ci| int [OH_Ability_CreateNativeChildProcess](#oh_ability_createnativechildprocess) (const char \*libName, [OH_Ability_OnNativeChildProcessStarted](#oh_ability_onnativechildprocessstarted) onProcessStarted) | Creates a child process, loads the specified dynamic library file, and returns the startup result asynchronously through a callback parameter. The callback notification is an independent thread. When implementing the callback function, pay attention to thread synchronization and do not perform time-consuming operations to avoid long-time blocking.| 47e41f4b71Sopenharmony_ci 48e41f4b71Sopenharmony_ci> **NOTE** 49e41f4b71Sopenharmony_ci> 50e41f4b71Sopenharmony_ci> Currently, only 2-in-1 devices are supported, and only one native child process can be started for a process. 51e41f4b71Sopenharmony_ci 52e41f4b71Sopenharmony_ci## Type Description 53e41f4b71Sopenharmony_ci### OH_Ability_OnNativeChildProcessStarted 54e41f4b71Sopenharmony_ci 55e41f4b71Sopenharmony_ci``` 56e41f4b71Sopenharmony_citypedef void (*OH_Ability_OnNativeChildProcessStarted)(int errCode, OHIPCRemoteProxy *remoteProxy) 57e41f4b71Sopenharmony_ci``` 58e41f4b71Sopenharmony_ci 59e41f4b71Sopenharmony_ci**Description** 60e41f4b71Sopenharmony_ci 61e41f4b71Sopenharmony_ciDefines a callback function for notifying the child process startup result. 62e41f4b71Sopenharmony_ci 63e41f4b71Sopenharmony_ci**Since**: 12 64e41f4b71Sopenharmony_ci 65e41f4b71Sopenharmony_ci**Parameters** 66e41f4b71Sopenharmony_ci 67e41f4b71Sopenharmony_ci| Name | Description | 68e41f4b71Sopenharmony_ci| ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | 69e41f4b71Sopenharmony_ci| errCode | NCP_NO_ERROR - The child process is created successfully.<br>NCP_ERR_LIB_LOADING_FAILED - Loading the dynamic library file fails or the necessary export function is not implemented in the dynamic library.<br>NCP_ERR_CONNECTION_FAILED - The OnConnect method implemented in the dynamic library does not return a valid IPC stub pointer.<br>For details, see [Ability_NativeChildProcess_ErrCode](#ability_nativechildprocess_errcode).| 70e41f4b71Sopenharmony_ci| remoteProxy | Pointer to the IPC object of the child process. If an exception occurs, the value may be nullptr. The pointer must be released by calling [OH_IPCRemoteProxy_Destory](../apis-ipc-kit/_o_h_i_p_c_remote_object.md#oh_ipcremoteproxy_destroy) when it is no longer needed. | 71e41f4b71Sopenharmony_ci 72e41f4b71Sopenharmony_ci**See** 73e41f4b71Sopenharmony_ci 74e41f4b71Sopenharmony_ci[OH_Ability_CreateNativeChildProcess](#oh_ability_createnativechildprocess) 75e41f4b71Sopenharmony_ci 76e41f4b71Sopenharmony_ci[OH_IPCRemoteProxy_Destory](../apis-ipc-kit/_o_h_i_p_c_remote_object.md#oh_ipcremoteproxy_destroy) 77e41f4b71Sopenharmony_ci 78e41f4b71Sopenharmony_ci### NativeChildProcess_Fd 79e41f4b71Sopenharmony_ci 80e41f4b71Sopenharmony_ci``` 81e41f4b71Sopenharmony_citypedef struct NativeChildProcess_Fd { 82e41f4b71Sopenharmony_ci char* fdName; 83e41f4b71Sopenharmony_ci int32_t fd; 84e41f4b71Sopenharmony_ci struct NativeChildProcess_Fd* next; 85e41f4b71Sopenharmony_ci} NativeChildProcess_Fd; 86e41f4b71Sopenharmony_ci``` 87e41f4b71Sopenharmony_ci 88e41f4b71Sopenharmony_ci**Description** 89e41f4b71Sopenharmony_ci 90e41f4b71Sopenharmony_ciDefines a struct for the file descriptor of a child process. 91e41f4b71Sopenharmony_ci 92e41f4b71Sopenharmony_ci**Since**: 13 93e41f4b71Sopenharmony_ci 94e41f4b71Sopenharmony_ci**Parameters** 95e41f4b71Sopenharmony_ci 96e41f4b71Sopenharmony_ci| Name | Description| 97e41f4b71Sopenharmony_ci| ----------- | ------------- | 98e41f4b71Sopenharmony_ci| fdName | Pointer to the keyword of the file descriptor. A maximum of 20 characters are allowed.| 99e41f4b71Sopenharmony_ci| fd | File descriptor handle.| 100e41f4b71Sopenharmony_ci| next | Pointer to the next file descriptor.| 101e41f4b71Sopenharmony_ci 102e41f4b71Sopenharmony_ci### NativeChildProcess_FdList 103e41f4b71Sopenharmony_ci 104e41f4b71Sopenharmony_ci``` 105e41f4b71Sopenharmony_citypedef struct NativeChildProcess_FdList { 106e41f4b71Sopenharmony_ci struct NativeChildProcess_Fd* head; 107e41f4b71Sopenharmony_ci} NativeChildProcess_FdList; 108e41f4b71Sopenharmony_ci``` 109e41f4b71Sopenharmony_ci 110e41f4b71Sopenharmony_ci**Description** 111e41f4b71Sopenharmony_ci 112e41f4b71Sopenharmony_ciDefines a struct for the linked list of file descriptors of a child process. A maximum of 16 file descriptors are supported. 113e41f4b71Sopenharmony_ci 114e41f4b71Sopenharmony_ci**Since**: 13 115e41f4b71Sopenharmony_ci 116e41f4b71Sopenharmony_ci**Parameters** 117e41f4b71Sopenharmony_ci 118e41f4b71Sopenharmony_ci| Name | Description| 119e41f4b71Sopenharmony_ci| ----------- | ------------- | 120e41f4b71Sopenharmony_ci| head | First file descriptor record in the linked list. For details, see [NativeChildProcess_FdList](#nativechildprocess_fdlist).| 121e41f4b71Sopenharmony_ci 122e41f4b71Sopenharmony_ci### NativeChildProcess_Args 123e41f4b71Sopenharmony_ci 124e41f4b71Sopenharmony_ci``` 125e41f4b71Sopenharmony_citypedef struct NativeChildProcess_Args { 126e41f4b71Sopenharmony_ci char* entryParams; 127e41f4b71Sopenharmony_ci struct NativeChildProcess_FdList fdList; 128e41f4b71Sopenharmony_ci} NativeChildProcess_Args; 129e41f4b71Sopenharmony_ci``` 130e41f4b71Sopenharmony_ci 131e41f4b71Sopenharmony_ci**Description** 132e41f4b71Sopenharmony_ci 133e41f4b71Sopenharmony_ciDefines a struct for the arguments used for starting a child process. 134e41f4b71Sopenharmony_ci 135e41f4b71Sopenharmony_ci**Since**: 13 136e41f4b71Sopenharmony_ci 137e41f4b71Sopenharmony_ci**Parameters** 138e41f4b71Sopenharmony_ci 139e41f4b71Sopenharmony_ci| Name | Description| 140e41f4b71Sopenharmony_ci| ----------- | ------------- | 141e41f4b71Sopenharmony_ci| entryParams | Pointer to the entry parameters. The size cannot exceed 150 KB.| 142e41f4b71Sopenharmony_ci| fdList | Linked list of File descriptors. For details, see [NativeChildProcess_FdList](#nativechildprocess_fdlist).| 143e41f4b71Sopenharmony_ci 144e41f4b71Sopenharmony_ci### NativeChildProcess_Options 145e41f4b71Sopenharmony_ci 146e41f4b71Sopenharmony_ci``` 147e41f4b71Sopenharmony_citypedef struct NativeChildProcess_Options { 148e41f4b71Sopenharmony_ci NativeChildProcess_IsolationMode isolationMode; 149e41f4b71Sopenharmony_ci int64_t reserved; 150e41f4b71Sopenharmony_ci} NativeChildProcess_Options; 151e41f4b71Sopenharmony_ci``` 152e41f4b71Sopenharmony_ci 153e41f4b71Sopenharmony_ci**Description** 154e41f4b71Sopenharmony_ci 155e41f4b71Sopenharmony_ciDefines a struct for the child process options. 156e41f4b71Sopenharmony_ci 157e41f4b71Sopenharmony_ci**Since**: 13 158e41f4b71Sopenharmony_ci 159e41f4b71Sopenharmony_ci**Parameters** 160e41f4b71Sopenharmony_ci 161e41f4b71Sopenharmony_ci| Name | Description| 162e41f4b71Sopenharmony_ci| ----------- | ------------- | 163e41f4b71Sopenharmony_ci| isolationMode | Process isolation mode. For details, see [NativeChildProcess_IsolationMode](#nativechildprocess_isolationmode).| 164e41f4b71Sopenharmony_ci| reserved | Reserved field.| 165e41f4b71Sopenharmony_ci 166e41f4b71Sopenharmony_ci## Enum Description 167e41f4b71Sopenharmony_ci 168e41f4b71Sopenharmony_ci### Ability_NativeChildProcess_ErrCode 169e41f4b71Sopenharmony_ci 170e41f4b71Sopenharmony_ci``` 171e41f4b71Sopenharmony_cienum Ability_NativeChildProcess_ErrCode 172e41f4b71Sopenharmony_ci``` 173e41f4b71Sopenharmony_ci 174e41f4b71Sopenharmony_ci**Description** 175e41f4b71Sopenharmony_ci 176e41f4b71Sopenharmony_ciEnumerates the error codes used by the native child process module. 177e41f4b71Sopenharmony_ci 178e41f4b71Sopenharmony_ci**Since**: 12 179e41f4b71Sopenharmony_ci 180e41f4b71Sopenharmony_ci| Value | Description | 181e41f4b71Sopenharmony_ci| ----------------------------------- | ----------------------------------------------- | 182e41f4b71Sopenharmony_ci| NCP_NO_ERROR | Operation successful. | 183e41f4b71Sopenharmony_ci| NCP_ERR_INVALID_PARAM | Invalid parameter. | 184e41f4b71Sopenharmony_ci| NCP_ERR_NOT_SUPPORTED | Creating a native child process is not supported. | 185e41f4b71Sopenharmony_ci| NCP_ERR_INTERNAL | Internal error. | 186e41f4b71Sopenharmony_ci| NCP_ERR_BUSY | A new child process cannot be created during the startup of another native child process. You can try again after the child process is started.| 187e41f4b71Sopenharmony_ci| NCP_ERR_TIMEOUT | Starting the native child process times out. | 188e41f4b71Sopenharmony_ci| NCP_ERR_SERVICE_ERROR | Server error. | 189e41f4b71Sopenharmony_ci| NCP_ERR_MULTI_PROCESS_DISABLED | The multi-process mode is disabled. A child process cannot be started. | 190e41f4b71Sopenharmony_ci| NCP_ERR_ALREADY_IN_CHILD | A process cannot be created in a child process. | 191e41f4b71Sopenharmony_ci| NCP_ERR_MAX_CHILD_PROCESSES_REACHED | The number of native child processes reaches the maximum. | 192e41f4b71Sopenharmony_ci| NCP_ERR_LIB_LOADING_FAILED | The child process fails to load the dynamic library because the file does not exist or the corresponding method is not implemented or exported. | 193e41f4b71Sopenharmony_ci| NCP_ERR_CONNECTION_FAILED | The child process fails to call the OnConnect method of the dynamic library. An invalid IPC object pointer may be returned. | 194e41f4b71Sopenharmony_ci 195e41f4b71Sopenharmony_ci### NativeChildProcess_IsolationMode 196e41f4b71Sopenharmony_ci 197e41f4b71Sopenharmony_ci``` 198e41f4b71Sopenharmony_cienum NativeChildProcess_IsolationMode 199e41f4b71Sopenharmony_ci``` 200e41f4b71Sopenharmony_ci 201e41f4b71Sopenharmony_ci**Description** 202e41f4b71Sopenharmony_ci 203e41f4b71Sopenharmony_ciEnumerates the isolation modes of a child process. 204e41f4b71Sopenharmony_ci 205e41f4b71Sopenharmony_ci**Since**: 13 206e41f4b71Sopenharmony_ci 207e41f4b71Sopenharmony_ci| Value | Description | 208e41f4b71Sopenharmony_ci| ----------------------------------- | ----------------------------------------------- | 209e41f4b71Sopenharmony_ci| NCP_ISOLATION_MODE_NORMAL | Normal mode. The child process shares the data sandbox and network environment with the main process.| 210e41f4b71Sopenharmony_ci| NCP_ISOLATION_MODE_ISOLATED | Isolated mode. The child process does not share the data sandbox and network environment with the main process.| 211e41f4b71Sopenharmony_ci 212e41f4b71Sopenharmony_ci## Function Description 213e41f4b71Sopenharmony_ci 214e41f4b71Sopenharmony_ci### OH_Ability_CreateNativeChildProcess 215e41f4b71Sopenharmony_ci 216e41f4b71Sopenharmony_ci``` 217e41f4b71Sopenharmony_ciint OH_Ability_CreateNativeChildProcess (const char *libName, OH_Ability_OnNativeChildProcessStarted onProcessStarted ) 218e41f4b71Sopenharmony_ci``` 219e41f4b71Sopenharmony_ci 220e41f4b71Sopenharmony_ci**Description** 221e41f4b71Sopenharmony_ci 222e41f4b71Sopenharmony_ciCreates a child process, loads the specified dynamic library file, and returns the startup result asynchronously through a callback parameter. The callback notification is an independent thread. When implementing the callback function, pay attention to thread synchronization and do not perform time-consuming operations to avoid long-time blocking. 223e41f4b71Sopenharmony_ci 224e41f4b71Sopenharmony_ciThe dynamic library specified must implement and export the following functions: 225e41f4b71Sopenharmony_ci 226e41f4b71Sopenharmony_ci 1. OHIPCRemoteStub* NativeChildProcess_OnConnect() 227e41f4b71Sopenharmony_ci 2. void NativeChildProcess_MainProc() 228e41f4b71Sopenharmony_ci 229e41f4b71Sopenharmony_ciThe processing logic sequence is shown in the following pseudocode: 230e41f4b71Sopenharmony_ci 231e41f4b71Sopenharmony_ci Parent process: 232e41f4b71Sopenharmony_ci 1. OH_Ability_CreateNativeChildProcess(libName, onProcessStartedCallback) 233e41f4b71Sopenharmony_ci 234e41f4b71Sopenharmony_ci Child process: 235e41f4b71Sopenharmony_ci 2. dlopen(libName) 236e41f4b71Sopenharmony_ci 3. dlsym("NativeChildProcess_OnConnect") 237e41f4b71Sopenharmony_ci 4. dlsym("NativeChildProcess_MainProc") 238e41f4b71Sopenharmony_ci 5. ipcRemote = NativeChildProcess_OnConnect() 239e41f4b71Sopenharmony_ci 6. NativeChildProcess_MainProc() 240e41f4b71Sopenharmony_ci 241e41f4b71Sopenharmony_ci Parent process: 242e41f4b71Sopenharmony_ci 7. onProcessStartedCallback(ipcRemote, errCode) 243e41f4b71Sopenharmony_ci 244e41f4b71Sopenharmony_ci Child process: 245e41f4b71Sopenharmony_ci 8. The child process exits after the NativeChildProcess_MainProc() function is returned. 246e41f4b71Sopenharmony_ci 247e41f4b71Sopenharmony_ci> **NOTE** 248e41f4b71Sopenharmony_ci> 249e41f4b71Sopenharmony_ci> Currently, only 2-in-1 devices are supported, and only one native child process can be started for a process. 250e41f4b71Sopenharmony_ci 251e41f4b71Sopenharmony_ci**Since**: 12 252e41f4b71Sopenharmony_ci 253e41f4b71Sopenharmony_ci**Parameters** 254e41f4b71Sopenharmony_ci 255e41f4b71Sopenharmony_ci| Name | Description | 256e41f4b71Sopenharmony_ci| ------------------------ | --------------------------------------------------------------------------------------------------------------- | 257e41f4b71Sopenharmony_ci| libName | Pointer to the name of the dynamic library file loaded in the child process. The value cannot be nullptr. | 258e41f4b71Sopenharmony_ci| onProcessStartedCallback | Pointer to the callback function for notifying the child process startup result. The value cannot be nullptr. For details, see [OH_Ability_OnNativeChildProcessStarted](#oh_ability_onnativechildprocessstarted).| 259e41f4b71Sopenharmony_ci 260e41f4b71Sopenharmony_ci 261e41f4b71Sopenharmony_ci**Returns** 262e41f4b71Sopenharmony_ci 263e41f4b71Sopenharmony_ciReturns **NCP_NO_ERROR** if the operation is successful; returns an error code defined in [Ability_NativeChildProcess_ErrCode](#ability_nativechildprocess_errcode) otherwise. 264e41f4b71Sopenharmony_ci 265e41f4b71Sopenharmony_ci### OH_Ability_StartNativeChildProcess 266e41f4b71Sopenharmony_ci 267e41f4b71Sopenharmony_ci``` 268e41f4b71Sopenharmony_ciAbility_NativeChildProcess_ErrCode OH_Ability_StartNativeChildProcess( 269e41f4b71Sopenharmony_ci const char* entry, NativeChildProcess_Args args, 270e41f4b71Sopenharmony_ci NativeChildProcess_Options options, int32_t *pid) 271e41f4b71Sopenharmony_ci``` 272e41f4b71Sopenharmony_ci 273e41f4b71Sopenharmony_ci**Description** 274e41f4b71Sopenharmony_ci 275e41f4b71Sopenharmony_ciStarts a native child process, loads the specified dynamic library file, and calls the entry function. Arguments can be passed to the child process. The ArkTS basic runtime environment cannot be created in the child process. 276e41f4b71Sopenharmony_ci 277e41f4b71Sopenharmony_ciThe specified dynamic library must implement and export the entry parameters of [NativeChildProcess_Args] (#nativechildprocess_args). For details, see [Native Child Process Development (C/C++) - Creating a Child Process That Supports Pass-by-Parameter](../../application-models/capi_nativechildprocess_development_guideline.md#creating-a-child-process-that-supports-pass-by-parameter). 278e41f4b71Sopenharmony_ci 279e41f4b71Sopenharmony_ci> **NOTE** 280e41f4b71Sopenharmony_ci> 281e41f4b71Sopenharmony_ci> This function is valid only for 2-in-1 devices and tablets. 282e41f4b71Sopenharmony_ci 283e41f4b71Sopenharmony_ci**Since**: 13 284e41f4b71Sopenharmony_ci 285e41f4b71Sopenharmony_ci**Parameters** 286e41f4b71Sopenharmony_ci 287e41f4b71Sopenharmony_ci| Name | Description| 288e41f4b71Sopenharmony_ci| ---------------------- | ---------------- | 289e41f4b71Sopenharmony_ci| entry | The symbol and entry function of the dynamic library called in the child process are separated by a colon (:), for example, **libentry.so:Main**. The value cannot be a null pointer.| 290e41f4b71Sopenharmony_ci| args | Arguments passed to the child process. For details, see [NativeChildProcess_Args](#nativechildprocess_args).| 291e41f4b71Sopenharmony_ci| options | Startup configuration options of the child process. For details, see [NativeChildProcess_Options](#nativechildprocess_options).| 292e41f4b71Sopenharmony_ci| pid | ID of the child process to start.| 293e41f4b71Sopenharmony_ci 294e41f4b71Sopenharmony_ci 295e41f4b71Sopenharmony_ci**Returns** 296e41f4b71Sopenharmony_ci 297e41f4b71Sopenharmony_ciReturns **NCP_NO_ERROR** if the operation is successful; returns an error code defined in [Ability_NativeChildProcess_ErrCode](#ability_nativechildprocess_errcode) otherwise. 298e41f4b71Sopenharmony_ci 299e41f4b71Sopenharmony_ci <!--no_check-->