utsname.h 748 B

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