1 /* 2 * Copyright (c) 2023 Meta 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 #ifndef ZEPHYR_INCLUDE_POSIX_SYS_UTSNAME_H_ 7 #define ZEPHYR_INCLUDE_POSIX_SYS_UTSNAME_H_ 8 9 #include <zephyr/sys/util_macro.h> 10 11 #ifdef __cplusplus 12 extern "C" { 13 #endif 14 15 /* These are for compatibility / practicality */ 16 #define _UTSNAME_NODENAME_LENGTH \ 17 COND_CODE_1(CONFIG_POSIX_SINGLE_PROCESS, (CONFIG_POSIX_UNAME_VERSION_LEN), (0)) 18 #define _UTSNAME_VERSION_LENGTH \ 19 COND_CODE_1(CONFIG_POSIX_SINGLE_PROCESS, (CONFIG_POSIX_UNAME_VERSION_LEN), (0)) 20 21 struct utsname { 22 char sysname[sizeof("Zephyr")]; 23 char nodename[_UTSNAME_NODENAME_LENGTH + 1]; 24 char release[sizeof("99.99.99-rc1")]; 25 char version[_UTSNAME_VERSION_LENGTH + 1]; 26 char machine[sizeof(CONFIG_ARCH)]; 27 }; 28 29 int uname(struct utsname *name); 30 31 #ifdef __cplusplus 32 } 33 #endif 34 35 #endif /* ZEPHYR_INCLUDE_POSIX_SYS_UTSNAME_H_ */ 36