[Info-vax] This is for the folks who get comp.os.vms via the Info-VAX mailing list

Arne Vajhøj arne at vajhoej.dk
Wed Dec 13 15:42:40 EST 2023


On 12/13/2023 10:17 AM, Dan Cross wrote:
> In article <6578f284$0$705$14726298 at news.sunsite.dk>,
> Arne Vajhøj  <arne at vajhoej.dk> wrote:
>> [snip]
>>>
>>> Yes. Like I said above, it's emulating the various Unix APIs instead and
>>> providing the kinds of tools you would see under Linux. For anyone confused
>>> about the difference, look at the output of "uname -o" both under Cygwin
>>> and under Linux. Under Cygwin, "Cygwin" is output as the OS, not "Linux".
>>
>> #include <stdio.h>
>>
>> #include <sys/utsname.h>
>>
>> #include <sysinfoapi.h>
>> #include <winnt.h>
>>
>> int main()
>> {
>>      struct utsname un;
>>      uname(&un);
>>      printf("sysname=%s, release=%s\n", un.sysname, un.release);
>>      struct _OSVERSIONINFOA osvi;
>>      osvi.dwOSVersionInfoSize = sizeof(struct _OSVERSIONINFOA);
>>      GetVersionExA(&osvi);
>>      printf("%s major=%d minor=%d build=%d\n", osvi.dwPlatformId ==
>> VER_PLATFORM_WIN32_NT ? "NT" : "Unknown", osvi.dwMajorVersion,
>> osvi.dwMinorVersion, osvi.dwBuildNumber);
>>      return 0;
>> }
> 
> Don't you mean to use `%u` for the format specifier for the dwords?
> Those are unsigned.

True. %u would be the correct format.

Arne





More information about the Info-vax mailing list