1# os_account.h 2 3## Overview 4 5Defines the APIs for accessing and managing system account information. 6 7**Library**: libos_account_ndk.so 8 9**Header file**: <BasicServicesKit/os_account.h> 10 11**System capability**: SystemCapability.Account.OsAccount 12 13**Since**: 12 14 15**Related module**: [OsAccount](capi-osaccount.md) 16 17## Summary 18 19### Functions 20 21| Name| Description| 22| -- | -- | 23| [OsAccount_ErrCode OH_OsAccount_GetName(char *buffer, size_t buffer_size)](#oh_osaccount_getname) | Obtains the name of the system account to which the caller process belongs.| 24 25## Function Description 26 27### OH_OsAccount_GetName() 28 29``` 30OsAccount_ErrCode OH_OsAccount_GetName(char *buffer, size_t buffer_size) 31``` 32 33**Description** 34 35Obtains the name of the system account to which the caller process belongs. 36 37**System capability**: SystemCapability.Account.OsAccount 38 39**Since**: 12 40 41 42**Parameters** 43 44| Name| Description| 45| -- | -- | 46| char *buffer | Pointer to the system account name, which including the name of the maximum length (**LOGIN_NAME_MAX**) and the end character (**\0**).| 47| size_t buffer_size | Length of the system account name.| 48 49**Returns** 50 51| Type| Description| 52| -- | -- | 53| [OsAccount_ErrCode](capi-os-account-common-h.md#osaccount_errcode) | **OS_ACCOUNT_ERR_OK**: Operation successful.<br>**OS_ACCOUNT_ERR_INTERNAL_ERROR**: Internal error.<br>**OS_ACCOUNT_ERR_INVALID_PARAMETER**: Invalid parameter, indicating that the buffer is a null pointer, or the length of the system account name (excluding **\0**) is greater than or equal to the buffer size.| 54