New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
[gnulib.git] / lib / sys_utsname.in.h
1 /* Substitute for <sys/utsname.h>.
2    Copyright (C) 2009 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 #define _GL_SYS_UTSNAME_H
20
21 /* The definition of GL_LINK_WARNING is copied here.  */
22
23 /* The definition of _GL_ARG_NONNULL is copied here.  */
24
25
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29
30
31 /* Length of the entries in 'struct utsname' is 256.  */
32 #define _UTSNAME_LENGTH 256
33
34 #ifndef _UTSNAME_NODENAME_LENGTH
35 # define _UTSNAME_NODENAME_LENGTH _UTSNAME_LENGTH
36 #endif
37 #ifndef _UTSNAME_SYSNAME_LENGTH
38 # define _UTSNAME_SYSNAME_LENGTH _UTSNAME_LENGTH
39 #endif
40 #ifndef _UTSNAME_RELEASE_LENGTH
41 # define _UTSNAME_RELEASE_LENGTH _UTSNAME_LENGTH
42 #endif
43 #ifndef _UTSNAME_VERSION_LENGTH
44 # define _UTSNAME_VERSION_LENGTH _UTSNAME_LENGTH
45 #endif
46 #ifndef _UTSNAME_MACHINE_LENGTH
47 # define _UTSNAME_MACHINE_LENGTH _UTSNAME_LENGTH
48 #endif
49
50 /* Structure describing the system and machine.  */
51 struct utsname
52   {
53     /* Name of this node on the network.  */
54     char nodename[_UTSNAME_NODENAME_LENGTH];
55
56     /* Name of the implementation of the operating system.  */
57     char sysname[_UTSNAME_SYSNAME_LENGTH];
58     /* Current release level of this implementation.  */
59     char release[_UTSNAME_RELEASE_LENGTH];
60     /* Current version level of this release.  */
61     char version[_UTSNAME_VERSION_LENGTH];
62
63     /* Name of the hardware type the system is running on.  */
64     char machine[_UTSNAME_MACHINE_LENGTH];
65   };
66
67
68 #if @GNULIB_UNAME@
69 # if !@HAVE_UNAME@
70 extern int uname (struct utsname *buf) _GL_ARG_NONNULL ((1));
71 # endif
72 #elif defined GNULIB_POSIXCHECK
73 # undef uname
74 # define uname(b) \
75     (GL_LINK_WARNING ("uname is unportable - " \
76                       "use gnulib module uname for portability"), \
77      uname (b))
78 #endif
79
80
81 #ifdef __cplusplus
82 }
83 #endif
84
85
86 #endif /* _GL_SYS_UTSNAME_H */