xref: /linux/tools/include/nolibc/sys/utsname.h (revision 015a99fa76650e7d6efa3e36f20c0f5b346fe9ce)
1*0f971358SThomas Weißschuh /* SPDX-License-Identifier: LGPL-2.1 OR MIT */
2*0f971358SThomas Weißschuh /*
3*0f971358SThomas Weißschuh  * Utsname definitions for NOLIBC
4*0f971358SThomas Weißschuh  * Copyright (C) 2017-2021 Willy Tarreau <w@1wt.eu>
5*0f971358SThomas Weißschuh  */
6*0f971358SThomas Weißschuh 
7*0f971358SThomas Weißschuh /* make sure to include all global symbols */
8*0f971358SThomas Weißschuh #include "../nolibc.h"
9*0f971358SThomas Weißschuh 
10*0f971358SThomas Weißschuh #ifndef _NOLIBC_SYS_UTSNAME_H
11*0f971358SThomas Weißschuh #define _NOLIBC_SYS_UTSNAME_H
12*0f971358SThomas Weißschuh 
13*0f971358SThomas Weißschuh #include "../sys.h"
14*0f971358SThomas Weißschuh 
15*0f971358SThomas Weißschuh #include <linux/utsname.h>
16*0f971358SThomas Weißschuh 
17*0f971358SThomas Weißschuh /*
18*0f971358SThomas Weißschuh  * int uname(struct utsname *buf);
19*0f971358SThomas Weißschuh  */
20*0f971358SThomas Weißschuh 
21*0f971358SThomas Weißschuh struct utsname {
22*0f971358SThomas Weißschuh 	char sysname[65];
23*0f971358SThomas Weißschuh 	char nodename[65];
24*0f971358SThomas Weißschuh 	char release[65];
25*0f971358SThomas Weißschuh 	char version[65];
26*0f971358SThomas Weißschuh 	char machine[65];
27*0f971358SThomas Weißschuh 	char domainname[65];
28*0f971358SThomas Weißschuh };
29*0f971358SThomas Weißschuh 
30*0f971358SThomas Weißschuh static __attribute__((unused))
sys_uname(struct utsname * buf)31*0f971358SThomas Weißschuh int sys_uname(struct utsname *buf)
32*0f971358SThomas Weißschuh {
33*0f971358SThomas Weißschuh 	return my_syscall1(__NR_uname, buf);
34*0f971358SThomas Weißschuh }
35*0f971358SThomas Weißschuh 
36*0f971358SThomas Weißschuh static __attribute__((unused))
uname(struct utsname * buf)37*0f971358SThomas Weißschuh int uname(struct utsname *buf)
38*0f971358SThomas Weißschuh {
39*0f971358SThomas Weißschuh 	return __sysret(sys_uname(buf));
40*0f971358SThomas Weißschuh }
41*0f971358SThomas Weißschuh 
42*0f971358SThomas Weißschuh #endif /* _NOLIBC_SYS_UTSNAME_H */
43