1 /* Substitute for <sys/utsname.h>.
2 Copyright (C) 2009-2011 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)
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, write to the Free Software Foundation,
16 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
18 #ifndef _@GUARD_PREFIX@_SYS_UTSNAME_H
21 @PRAGMA_SYSTEM_HEADER@
25 #if @HAVE_SYS_UTSNAME_H@
27 /* Minix 3.1.8 has a bug: <stddef.h> must be included before <sys/utsname.h>.
28 But avoid namespace pollution on glibc systems. */
29 # if defined __minix && !defined __GLIBC__
33 # @INCLUDE_NEXT@ @NEXT_SYS_UTSNAME_H@
37 #define _@GUARD_PREFIX@_SYS_UTSNAME_H
39 /* The definition of _GL_ARG_NONNULL is copied here. */
41 /* The definition of _GL_WARN_ON_USE is copied here. */
48 #if !@HAVE_STRUCT_UTSNAME@
49 /* Length of the entries in 'struct utsname' is 256. */
50 # define _UTSNAME_LENGTH 256
52 # ifndef _UTSNAME_NODENAME_LENGTH
53 # define _UTSNAME_NODENAME_LENGTH _UTSNAME_LENGTH
55 # ifndef _UTSNAME_SYSNAME_LENGTH
56 # define _UTSNAME_SYSNAME_LENGTH _UTSNAME_LENGTH
58 # ifndef _UTSNAME_RELEASE_LENGTH
59 # define _UTSNAME_RELEASE_LENGTH _UTSNAME_LENGTH
61 # ifndef _UTSNAME_VERSION_LENGTH
62 # define _UTSNAME_VERSION_LENGTH _UTSNAME_LENGTH
64 # ifndef _UTSNAME_MACHINE_LENGTH
65 # define _UTSNAME_MACHINE_LENGTH _UTSNAME_LENGTH
68 # if !GNULIB_defined_struct_utsname
69 /* Structure describing the system and machine. */
72 /* Name of this node on the network. */
73 char nodename[_UTSNAME_NODENAME_LENGTH];
75 /* Name of the implementation of the operating system. */
76 char sysname[_UTSNAME_SYSNAME_LENGTH];
77 /* Current release level of this implementation. */
78 char release[_UTSNAME_RELEASE_LENGTH];
79 /* Current version level of this release. */
80 char version[_UTSNAME_VERSION_LENGTH];
82 /* Name of the hardware type the system is running on. */
83 char machine[_UTSNAME_MACHINE_LENGTH];
85 # define GNULIB_defined_struct_utsname 1
88 #endif /* !@HAVE_STRUCT_UTSNAME@ */
93 extern int uname (struct utsname *buf) _GL_ARG_NONNULL ((1));
95 #elif defined GNULIB_POSIXCHECK
97 # if HAVE_RAW_DECL_UNAME
98 _GL_WARN_ON_USE (uname, "uname is unportable - "
99 "use gnulib module uname for portability");
109 #endif /* _@GUARD_PREFIX@_SYS_UTSNAME_H */