timespec_get: New module.
[gnulib.git] / lib / sys_utsname.in.h
blobc0430ded7dfbc07737e737ac2d829c9734a367d6
1 /* Substitute for <sys/utsname.h>.
2 Copyright (C) 2009-2021 Free Software Foundation, Inc.
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2, or (at your option)
7 any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, see <https://www.gnu.org/licenses/>. */
17 #ifndef _@GUARD_PREFIX@_SYS_UTSNAME_H
19 #if __GNUC__ >= 3
20 @PRAGMA_SYSTEM_HEADER@
21 #endif
22 @PRAGMA_COLUMNS@
24 #if @HAVE_SYS_UTSNAME_H@
26 /* Minix 3.1.8 has a bug: <stddef.h> must be included before <sys/utsname.h>.
27 But avoid namespace pollution on glibc systems. */
28 # if defined __minix && !defined __GLIBC__
29 # include <stddef.h>
30 # endif
32 # @INCLUDE_NEXT@ @NEXT_SYS_UTSNAME_H@
34 #endif
36 #define _@GUARD_PREFIX@_SYS_UTSNAME_H
38 /* The definition of _GL_ARG_NONNULL is copied here. */
40 /* The definition of _GL_WARN_ON_USE is copied here. */
43 #ifdef __cplusplus
44 extern "C" {
45 #endif
47 #if !@HAVE_STRUCT_UTSNAME@
48 /* Length of the entries in 'struct utsname' is 256. */
49 # define _UTSNAME_LENGTH 256
51 # ifndef _UTSNAME_NODENAME_LENGTH
52 # define _UTSNAME_NODENAME_LENGTH _UTSNAME_LENGTH
53 # endif
54 # ifndef _UTSNAME_SYSNAME_LENGTH
55 # define _UTSNAME_SYSNAME_LENGTH _UTSNAME_LENGTH
56 # endif
57 # ifndef _UTSNAME_RELEASE_LENGTH
58 # define _UTSNAME_RELEASE_LENGTH _UTSNAME_LENGTH
59 # endif
60 # ifndef _UTSNAME_VERSION_LENGTH
61 # define _UTSNAME_VERSION_LENGTH _UTSNAME_LENGTH
62 # endif
63 # ifndef _UTSNAME_MACHINE_LENGTH
64 # define _UTSNAME_MACHINE_LENGTH _UTSNAME_LENGTH
65 # endif
67 # if !GNULIB_defined_struct_utsname
68 /* Structure describing the system and machine. */
69 struct utsname
71 /* Name of this node on the network. */
72 char nodename[_UTSNAME_NODENAME_LENGTH];
74 /* Name of the implementation of the operating system. */
75 char sysname[_UTSNAME_SYSNAME_LENGTH];
76 /* Current release level of this implementation. */
77 char release[_UTSNAME_RELEASE_LENGTH];
78 /* Current version level of this release. */
79 char version[_UTSNAME_VERSION_LENGTH];
81 /* Name of the hardware type the system is running on. */
82 char machine[_UTSNAME_MACHINE_LENGTH];
84 # define GNULIB_defined_struct_utsname 1
85 # endif
87 #endif /* !@HAVE_STRUCT_UTSNAME@ */
90 #if @GNULIB_UNAME@
91 # if !@HAVE_UNAME@
92 extern int uname (struct utsname *buf) _GL_ARG_NONNULL ((1));
93 # endif
94 #elif defined GNULIB_POSIXCHECK
95 # undef uname
96 # if HAVE_RAW_DECL_UNAME
97 _GL_WARN_ON_USE (uname, "uname is unportable - "
98 "use gnulib module uname for portability");
99 # endif
100 #endif
103 #ifdef __cplusplus
105 #endif
108 #endif /* _@GUARD_PREFIX@_SYS_UTSNAME_H */