1 #include "dact.h" 2 #include "uname.h" 3 #ifdef HAVE_STDIO_H 4 #include <stdio.h> 5 #endif 6 7 int uname(struct utsname *buf) { 8 #ifdef __WIN32__ 9 uint32_t winver; 10 SYSTEM_INFO winsysinfo; 11 #endif 12 13 if (buf==NULL) return(-1); 14 15 #ifdef __WIN32__ 16 GetSystemInfo(&winsysinfo); 17 winver=GetVersion(); 18 19 snprintf(buf->release, 64, "%i.%i", winver&0xff, (winver&0xff00)>>8); 20 snprintf(buf->machine, 64, "%lu", (unsigned long) winsysinfo.dwProcessorType); 21 strcpy(buf->sysname, "windows"); 22 #else 23 strcpy(buf->sysname, "(unknown)"); 24 strcpy(buf->machine, "(unknown)"); 25 strcpy(buf->release, "0.0.0"); 26 #endif 27 return(0); 28 } |