ntdll: Add a function to export the host OS type and version.
authorAlexandre Julliard <julliard@winehq.org>
Tue, 9 Dec 2008 18:33:06 +0000 (19:33 +0100)
committerAlexandre Julliard <julliard@winehq.org>
Tue, 9 Dec 2008 18:33:06 +0000 (19:33 +0100)
configure
configure.ac
dlls/ntdll/misc.c
dlls/ntdll/ntdll.spec
include/config.h.in

index 1ff8e1fade40a768aae16587f61384ec499e105b..eaa4da73f9e355796a581c1eb9117464ca27767e 100755 (executable)
--- a/configure
+++ b/configure
@@ -7435,6 +7435,7 @@ done
 
 
 
+
 
 
 for ac_header in \
@@ -7543,6 +7544,7 @@ for ac_header in \
        sys/times.h \
        sys/uio.h \
        sys/un.h \
+       sys/utsname.h \
        sys/vm86.h \
        sys/wait.h \
        syscall.h \
index 1dce0d130860a648ed09e98be9666fdf986d2d68..071013c47bde0fad8220c26fdbee32e3bf7500b3 100644 (file)
@@ -344,6 +344,7 @@ AC_CHECK_HEADERS(\
        sys/times.h \
        sys/uio.h \
        sys/un.h \
+       sys/utsname.h \
        sys/vm86.h \
        sys/wait.h \
        syscall.h \
index 218c2897bd31c86b9c688e0c8ef240955832e0e5..5272c875fb5da6678a9e5ab918495c8ab97644c2 100644 (file)
@@ -22,6 +22,9 @@
 
 #include <time.h>
 #include <math.h>
+#ifdef HAVE_SYS_UTSNAME_H
+#include <sys/utsname.h>
+#endif
 
 #include "wine/library.h"
 #include "wine/debug.h"
@@ -155,6 +158,28 @@ const char * CDECL NTDLL_wine_get_build_id(void)
     return wine_get_build_id();
 }
 
+/*********************************************************************
+ *                  wine_get_host_version   (NTDLL.@)
+ */
+void CDECL NTDLL_wine_get_host_version( const char **sysname, const char **release )
+{
+#ifdef HAVE_SYS_UTSNAME_H
+    static struct utsname buf;
+    static int init_done;
+
+    if (!init_done)
+    {
+        uname( &buf );
+        init_done = 1;
+    }
+    if (sysname) *sysname = buf.sysname;
+    if (release) *release = buf.release;
+#else
+    if (sysname) *sysname = "";
+    if (release) *release = "";
+#endif
+}
+
 /*********************************************************************
  *                  abs   (NTDLL.@)
  */
index d4c8d4e8e7f0ed5852f3c571f40bea4807d48b01..442516e5986c6309378f01f826731684b5677c54 100644 (file)
 # Version
 @ cdecl wine_get_version() NTDLL_wine_get_version
 @ cdecl wine_get_build_id() NTDLL_wine_get_build_id
+@ cdecl wine_get_host_version(ptr ptr) NTDLL_wine_get_host_version
 
 # Codepages
 @ cdecl __wine_init_codepages(ptr ptr ptr)
index 84c41deb628435979fd5e0e689c84aa2b05efcf5..c45765ea1ae51ce8ad58538d6282905f216563c7 100644 (file)
 /* Define to 1 if you have the <sys/user.h> header file. */
 #undef HAVE_SYS_USER_H
 
+/* Define to 1 if you have the <sys/utsname.h> header file. */
+#undef HAVE_SYS_UTSNAME_H
+
 /* Define to 1 if you have the <sys/vfs.h> header file. */
 #undef HAVE_SYS_VFS_H