2 // Interface to <sys/utsname.h>
4 module core
.sys
.posix
.sys
.utsname
;
12 else version (WatchOS
)
20 version (CRuntime_Glibc
)
22 private enum utsNameLength
= 65;
26 char[utsNameLength
] sysname
= 0;
27 char[utsNameLength
] nodename
= 0;
28 char[utsNameLength
] release
= 0;
29 char[utsNameLength
] version_
= 0;
30 // TODO Deprecate after version_ has been in an official release.
31 alias update
= version_
;
32 char[utsNameLength
] machine
= 0;
34 char[utsNameLength
] __domainname
= 0;
37 int uname(utsname
* __name
);
41 private enum utsNameLength
= 256;
45 char[utsNameLength
] sysname
= 0;
46 char[utsNameLength
] nodename
= 0;
47 char[utsNameLength
] release
= 0;
48 char[utsNameLength
] version_
= 0;
49 // TODO Deprecate after version_ has been in an official release.
50 alias update
= version_
;
51 char[utsNameLength
] machine
= 0;
54 int uname(utsname
* __name
);
56 else version (FreeBSD
)
58 //private enum SYS_NMLN = 32; // old FreeBSD 1.1 ABI
59 private enum SYS_NMLN
= 256;
63 char[SYS_NMLN
] sysname
= 0;
64 char[SYS_NMLN
] nodename
= 0;
65 char[SYS_NMLN
] release
= 0;
66 char[SYS_NMLN
] version_
= 0;
67 // TODO Deprecate after version_ has been in an official release.
68 alias update
= version_
;
69 char[SYS_NMLN
] machine
= 0;
72 int __xuname(int, void*);
73 int uname()(utsname
* __name
) { return __xuname(SYS_NMLN
, cast(void*) __name
); }
77 private enum utsNameLength
= 256;
81 char[utsNameLength
] sysname
= 0;
82 char[utsNameLength
] nodename
= 0;
83 char[utsNameLength
] release
= 0;
84 char[utsNameLength
] version_
= 0;
85 // TODO Deprecate after version_ has been in an official release.
86 alias update
= version_
;
87 char[utsNameLength
] machine
= 0;
90 int uname(utsname
* __name
);
92 else version (OpenBSD
)
94 private enum utsNameLength
= 256;
98 char[utsNameLength
] sysname
= 0;
99 char[utsNameLength
] nodename
= 0;
100 char[utsNameLength
] release
= 0;
101 char[utsNameLength
] version_
= 0;
102 char[utsNameLength
] machine
= 0;
105 int uname(utsname
* __name
);
107 else version (DragonFlyBSD
)
109 private enum utsNameLength
= 32;
113 char[utsNameLength
] sysname
= 0;
114 char[utsNameLength
] nodename
= 0;
115 char[utsNameLength
] release
= 0;
116 char[utsNameLength
] version_
= 0;
117 // TODO Deprecate after version_ has been in an official release.
118 alias update
= version_
;
119 char[utsNameLength
] machine
= 0;
122 int uname(utsname
* __name
);
124 else version (Solaris
)
126 private enum SYS_NMLN
= 257;
130 char[SYS_NMLN
] sysname
= 0;
131 char[SYS_NMLN
] nodename
= 0;
132 char[SYS_NMLN
] release
= 0;
133 // The field name is version but version is a keyword in D.
134 char[SYS_NMLN
] _version
= 0;
135 char[SYS_NMLN
] machine
= 0;
138 int uname(utsname
* __name
);
140 else version (CRuntime_Bionic
)
142 private enum SYS_NMLN
= 65;
146 char[SYS_NMLN
] sysname
= 0;
147 char[SYS_NMLN
] nodename
= 0;
148 char[SYS_NMLN
] release
= 0;
149 // The field name is version but version is a keyword in D.
150 char[SYS_NMLN
] _version
= 0;
151 char[SYS_NMLN
] machine
= 0;
152 char[SYS_NMLN
] domainname
= 0;
157 else version (CRuntime_Musl
)
159 private enum SYS_NMLN
= 65;
163 char[SYS_NMLN
] sysname
= 0;
164 char[SYS_NMLN
] nodename
= 0;
165 char[SYS_NMLN
] release
= 0;
166 char[SYS_NMLN
] _version
= 0;
167 char[SYS_NMLN
] machine
= 0;
168 char[SYS_NMLN
] domainname
= 0;
173 else version (CRuntime_UClibc
)
175 private enum utsNameLength
= 65;
179 char[utsNameLength
] sysname
= 0;
180 char[utsNameLength
] nodename
= 0;
181 char[utsNameLength
] release
= 0;
182 char[utsNameLength
] version_
= 0;
183 char[utsNameLength
] machine
= 0;
184 char[utsNameLength
] domainname
= 0;
191 static assert(false, "unsupported system");