utsname.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. //
  2. // Copyright 2026 Aarav Ravindra Kharade
  3. //
  4. // Licensed under the Apache License, Version 2.0 (the "License");
  5. // you may not use this file except in compliance with the License.
  6. // You may obtain a copy of the License at
  7. //
  8. // http://www.apache.org/licenses/LICENSE-2.0
  9. //
  10. // Unless required by applicable law or agreed to in writing, software
  11. // distributed under the License is distributed on an "AS IS" BASIS,
  12. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. // See the License for the specific language governing permissions and
  14. // limitations under the License.
  15. //
  16. /* Copyright (C) 1991-2026 Free Software Foundation, Inc.
  17. This file is part of the GNU C Library.
  18. The GNU C Library is free software; you can redistribute it and/or
  19. modify it under the terms of the GNU Lesser General Public
  20. License as published by the Free Software Foundation; either
  21. version 2.1 of the License, or (at your option) any later version.
  22. The GNU C Library is distributed in the hope that it will be useful,
  23. but WITHOUT ANY WARRANTY; without even the implied warranty of
  24. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  25. Lesser General Public License for more details.
  26. You should have received a copy of the GNU Lesser General Public
  27. License along with the GNU C Library; if not, see
  28. <https://www.gnu.org/licenses/>. */
  29. /*
  30. * POSIX Standard: 4.4 System Identification <sys/utsname.h>
  31. */
  32. #ifndef _SYS_UTSNAME_H
  33. #define _SYS_UTSNAME_H 1
  34. #include <features.h>
  35. __BEGIN_DECLS
  36. #include <bits/utsname.h>
  37. #ifndef _UTSNAME_SYSNAME_LENGTH
  38. # define _UTSNAME_SYSNAME_LENGTH _UTSNAME_LENGTH
  39. #endif
  40. #ifndef _UTSNAME_NODENAME_LENGTH
  41. # define _UTSNAME_NODENAME_LENGTH _UTSNAME_LENGTH
  42. #endif
  43. #ifndef _UTSNAME_RELEASE_LENGTH
  44. # define _UTSNAME_RELEASE_LENGTH _UTSNAME_LENGTH
  45. #endif
  46. #ifndef _UTSNAME_VERSION_LENGTH
  47. # define _UTSNAME_VERSION_LENGTH _UTSNAME_LENGTH
  48. #endif
  49. #ifndef _UTSNAME_MACHINE_LENGTH
  50. # define _UTSNAME_MACHINE_LENGTH _UTSNAME_LENGTH
  51. #endif
  52. /* Structure describing the system and machine. */
  53. struct utsname
  54. {
  55. /* Name of the implementation of the operating system. */
  56. char sysname[_UTSNAME_SYSNAME_LENGTH];
  57. /* Name of this node on the network. */
  58. char nodename[_UTSNAME_NODENAME_LENGTH];
  59. /* Current release level of this implementation. */
  60. char release[_UTSNAME_RELEASE_LENGTH];
  61. /* Current version level of this release. */
  62. char version[_UTSNAME_VERSION_LENGTH];
  63. /* Name of the hardware type the system is running on. */
  64. char machine[_UTSNAME_MACHINE_LENGTH];
  65. #if _UTSNAME_DOMAIN_LENGTH - 0
  66. /* Name of the domain of this node on the network. */
  67. # ifdef __USE_GNU
  68. char domainname[_UTSNAME_DOMAIN_LENGTH];
  69. # else
  70. char __domainname[_UTSNAME_DOMAIN_LENGTH];
  71. # endif
  72. #endif
  73. };
  74. #ifdef __USE_MISC
  75. /* Note that SVID assumes all members have the same size. */
  76. # define SYS_NMLN _UTSNAME_LENGTH
  77. #endif
  78. /* Put information about the system in NAME. */
  79. extern int uname (struct utsname *__name) __THROW;
  80. __END_DECLS
  81. #endif /* sys/utsname.h */