frexpl: Update regarding AIX.
[gnulib.git] / lib / sys_utsname.in.h
1 /* Substitute for <sys/utsname.h>.
2    Copyright (C) 2009, 2010 Free Software Foundation, Inc.
3
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.
8
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.
13
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.  */
17
18 #ifndef _GL_SYS_UTSNAME_H
19
20 #if __GNUC__ >= 3
21 @PRAGMA_SYSTEM_HEADER@
22 #endif
23
24 #if @HAVE_SYS_UTSNAME_H@
25 # @INCLUDE_NEXT@ @NEXT_SYS_UTSNAME_H@
26 #endif
27
28 #define _GL_SYS_UTSNAME_H
29
30 /* The definition of _GL_ARG_NONNULL is copied here.  */
31
32 /* The definition of _GL_WARN_ON_USE is copied here.  */
33
34
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38
39 #if !@HAVE_STRUCT_UTSNAME@
40 /* Length of the entries in 'struct utsname' is 256.  */
41 # define _UTSNAME_LENGTH 256
42
43 # ifndef _UTSNAME_NODENAME_LENGTH
44 #  define _UTSNAME_NODENAME_LENGTH _UTSNAME_LENGTH
45 # endif
46 # ifndef _UTSNAME_SYSNAME_LENGTH
47 #  define _UTSNAME_SYSNAME_LENGTH _UTSNAME_LENGTH
48 # endif
49 # ifndef _UTSNAME_RELEASE_LENGTH
50 #  define _UTSNAME_RELEASE_LENGTH _UTSNAME_LENGTH
51 # endif
52 # ifndef _UTSNAME_VERSION_LENGTH
53 #  define _UTSNAME_VERSION_LENGTH _UTSNAME_LENGTH
54 # endif
55 # ifndef _UTSNAME_MACHINE_LENGTH
56 #  define _UTSNAME_MACHINE_LENGTH _UTSNAME_LENGTH
57 # endif
58
59 /* Structure describing the system and machine.  */
60 struct utsname
61   {
62     /* Name of this node on the network.  */
63     char nodename[_UTSNAME_NODENAME_LENGTH];
64
65     /* Name of the implementation of the operating system.  */
66     char sysname[_UTSNAME_SYSNAME_LENGTH];
67     /* Current release level of this implementation.  */
68     char release[_UTSNAME_RELEASE_LENGTH];
69     /* Current version level of this release.  */
70     char version[_UTSNAME_VERSION_LENGTH];
71
72     /* Name of the hardware type the system is running on.  */
73     char machine[_UTSNAME_MACHINE_LENGTH];
74   };
75 #endif /* !@HAVE_STRUCT_UTSNAME@ */
76
77
78 #if @GNULIB_UNAME@
79 # if !@HAVE_UNAME@
80 extern int uname (struct utsname *buf) _GL_ARG_NONNULL ((1));
81 # endif
82 #elif defined GNULIB_POSIXCHECK
83 # undef uname
84 # if HAVE_RAW_DECL_UNAME
85 _GL_WARN_ON_USE (uname, "uname is unportable - "
86                  "use gnulib module uname for portability");
87 # endif
88 #endif
89
90
91 #ifdef __cplusplus
92 }
93 #endif
94
95
96 #endif /* _GL_SYS_UTSNAME_H */