1 /** 2 * D header file for POSIX. 3 * 4 * Copyright: Public Domain 5 * License: Public Domain 6 * Authors: Jacob Carlborg 7 * Standards: The Open Group Base Specifications Issue 6, IEEE Std 1003.1, 2004 Edition 8 * References: The Open Group $(LINK2 http://www.opengroup.org/onlinepubs/009695399/functions/uname.html, sys/utsname.h) $(BR) 9 * Mac OS X $(LINK2 http://developer.apple.com/documentation/Darwin/Reference/Manpages/man3/uname.3.html, sys/utsname.h) $(BR) 10 * FreeBSD $(LINK2 http://www.freebsd.org/cgi/man.cgi?query=uname&sektion=3&apropos=0&manpath=FreeBSD+7.1-RELEASE, sys/utsname.h) $(BR) 11 * Linux $(LINK2 http://www.gnu.org/software/libc/manual/html_node/Platform-Type.html, sys/utsname.h) 12 */ 13 module tango.stdc.posix.sys.utsname; 14 15 extern (C): 16 17 version(OSX) 18 { 19 private const size_t len = 256; 20 21 struct utsname 22 { 23 char[len] sysname; 24 char[len] nodename; 25 char[len] release; 26 char[len] version_; // appended a _ because of the otherwise keyword conflict 27 char[len] machine; 28 } 29 } 30 31 else version (FreeBSD) 32 { 33 private const size_t len = 256; 34 35 struct utsname 36 { 37 char[len] sysname; 38 char[len] nodename; 39 char[len] release; 40 char[len] version_; // appended a _ because of the otherwise keyword conflict 41 char[len] machine; 42 } 43 } 44 45 else version (linux) 46 { 47 private const size_t len = 65; 48 49 struct utsname 50 { 51 char[len] sysname; 52 char[len] nodename; 53 char[len] release; 54 char[len] version_; // appended a _ because of the otherwise keyword conflict 55 char[len] machine; 56 char[len] domainname; 57 } 58 } 59 60 else version (solaris) 61 { 62 private const size_t len = 257; 63 64 struct utsname 65 { 66 char[len] sysname; 67 char[len] nodename; 68 char[len] release; 69 char[len] version_; // appended a _ because of the otherwise keyword conflict 70 char[len] machine; 71 } 72 } 73 74 else 75 static assert(false, "utsname is not available on this platform"); 76 77 int uname(utsname*);