utsname.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /* Copyright (C) 1991,92,94,96,97,99,2002 Free Software Foundation, Inc.
  2. This file is part of the GNU C Library.
  3. The GNU C Library is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU Lesser General Public
  5. License as published by the Free Software Foundation; either
  6. version 2.1 of the License, or (at your option) any later version.
  7. The GNU C Library is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  10. Lesser General Public License for more details.
  11. You should have received a copy of the GNU Lesser General Public
  12. License along with the GNU C Library; if not, see
  13. <http://www.gnu.org/licenses/>. */
  14. /*
  15. * POSIX Standard: 4.4 System Identification <sys/utsname.h>
  16. */
  17. #ifndef _SYS_UTSNAME_H
  18. #define _SYS_UTSNAME_H 1
  19. #include <features.h>
  20. __BEGIN_DECLS
  21. #include <bits/utsname.h>
  22. #ifndef _UTSNAME_SYSNAME_LENGTH
  23. # define _UTSNAME_SYSNAME_LENGTH _UTSNAME_LENGTH
  24. #endif
  25. #ifndef _UTSNAME_NODENAME_LENGTH
  26. # define _UTSNAME_NODENAME_LENGTH _UTSNAME_LENGTH
  27. #endif
  28. #ifndef _UTSNAME_RELEASE_LENGTH
  29. # define _UTSNAME_RELEASE_LENGTH _UTSNAME_LENGTH
  30. #endif
  31. #ifndef _UTSNAME_VERSION_LENGTH
  32. # define _UTSNAME_VERSION_LENGTH _UTSNAME_LENGTH
  33. #endif
  34. #ifndef _UTSNAME_MACHINE_LENGTH
  35. # define _UTSNAME_MACHINE_LENGTH _UTSNAME_LENGTH
  36. #endif
  37. /* Structure describing the system and machine. */
  38. struct utsname
  39. {
  40. /* Name of the implementation of the operating system. */
  41. char sysname[_UTSNAME_SYSNAME_LENGTH];
  42. /* Name of this node on the network. */
  43. char nodename[_UTSNAME_NODENAME_LENGTH];
  44. /* Current release level of this implementation. */
  45. char release[_UTSNAME_RELEASE_LENGTH];
  46. /* Current version level of this release. */
  47. char version[_UTSNAME_VERSION_LENGTH];
  48. /* Name of the hardware type the system is running on. */
  49. char machine[_UTSNAME_MACHINE_LENGTH];
  50. #if _UTSNAME_DOMAIN_LENGTH - 0
  51. /* Name of the domain of this node on the network. */
  52. # ifdef __USE_GNU
  53. char domainname[_UTSNAME_DOMAIN_LENGTH];
  54. # else
  55. char __domainname[_UTSNAME_DOMAIN_LENGTH];
  56. # endif
  57. #endif
  58. };
  59. #ifdef __USE_SVID
  60. /* Note that SVID assumes all members have the same size. */
  61. # define SYS_NMLN _UTSNAME_LENGTH
  62. #endif
  63. /* Put information about the system in NAME. */
  64. extern int uname (struct utsname *__name) __THROW;
  65. libc_hidden_proto(uname)
  66. __END_DECLS
  67. #endif /* sys/utsname.h */