utsname.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. /*++
  2. Copyright (c) 2013 Minoca Corp.
  3. This file is licensed under the terms of the GNU Lesser General Public
  4. License version 3. Alternative licensing terms are available. Contact
  5. info@minocacorp.com for details.
  6. Module Name:
  7. utsname.h
  8. Abstract:
  9. This header contains definitions for getting the system name.
  10. Author:
  11. Evan Green 17-Jul-2013
  12. --*/
  13. #ifndef _UTSNAME_H
  14. #define _UTSNAME_H
  15. //
  16. // ------------------------------------------------------------------- Includes
  17. //
  18. #include <libcbase.h>
  19. #include <limits.h>
  20. //
  21. // ---------------------------------------------------------------- Definitions
  22. //
  23. #ifdef __cplusplus
  24. extern "C" {
  25. #endif
  26. //
  27. // Define the maximum length of each of the strings in the utsname structure.
  28. //
  29. #define UTSNAME_STRING_SIZE 80
  30. //
  31. // ------------------------------------------------------ Data Type Definitions
  32. //
  33. /*++
  34. Structure Description:
  35. This structure defines the buffer used to name the machine.
  36. Members:
  37. sysname - Stores a string describing the name of this implementation of
  38. the operating system.
  39. nodename - Stores a string describing the name of this node within the
  40. communications network to which this node is attached, if any.
  41. release - Stores a string containing the release level of this
  42. implementation.
  43. version - Stores a string containing the version level of this release.
  44. machine - Stores the name of the hardware type on which the system is
  45. running.
  46. domainname - Stores the name of the network domain this machine resides in,
  47. if any.
  48. --*/
  49. struct utsname {
  50. char sysname[UTSNAME_STRING_SIZE];
  51. char nodename[HOST_NAME_MAX];
  52. char release[UTSNAME_STRING_SIZE];
  53. char version[UTSNAME_STRING_SIZE];
  54. char machine[UTSNAME_STRING_SIZE];
  55. char domainname[UTSNAME_STRING_SIZE];
  56. };
  57. //
  58. // -------------------------------------------------------------------- Globals
  59. //
  60. //
  61. // -------------------------------------------------------- Function Prototypes
  62. //
  63. LIBC_API
  64. int
  65. uname (
  66. struct utsname *Name
  67. );
  68. /*++
  69. Routine Description:
  70. This routine returns the system name and version.
  71. Arguments:
  72. Name - Supplies a pointer to a name structure to fill out.
  73. Return Value:
  74. Returns a non-negative value on success.
  75. -1 on error, and errno will be set to indicate the error.
  76. --*/
  77. #ifdef __cplusplus
  78. }
  79. #endif
  80. #endif