[Dev-luatex] os.uname on 64 bit Windows

Reinhard Kotucha reinhard.kotucha at web.de
Sun Sep 5 19:48:05 CEST 2021


On 2021-09-05 at 10:43:10 +0200, luigi scarso wrote:

 > On Sun, Sep 5, 2021 at 2:22 AM Reinhard Kotucha <reinhard.kotucha at web.de>
 > wrote:
 >
 > > Hi,
 > > on a 64 bit Windows machine os.uname() erroneously returns
 > >
 > >   machine       i686
 > >
 > > On the same machine I get under Linux
 > >
 > >   machine       x86_64
 > >
 > > with both, x86_64-linux and i386-linux binaries.  Thus I assume that
 > > the keyword 'machine' refers to the hardware, not to how the binaries
 > > were compiled (32 vs. 64 bit).
 > >
 > > The complete output of
 > >
 > >   for k,v in pairs(os.uname()) do
 > >     print(k,v)
 > >   end
 > >
 > > is
 > >
 > >   release       build 9200
 > >   nodename      R804
 > >   version       6.02
 > >   machine       i686
 > >   sysname       Windows 8
 > >
 > >
 >
 > #ifdef _WIN32
 > #  define _UTSNAME_LENGTH 65
 >
 > /* Structure describing the system and machine.  */
 > struct utsname {
 >     char sysname[_UTSNAME_LENGTH];
 >     char nodename[_UTSNAME_LENGTH];
 >     char release[_UTSNAME_LENGTH];
 >     char version[_UTSNAME_LENGTH];
 >     char machine[_UTSNAME_LENGTH];
 > };
 >
 > /*
 >  * Get name and information about current kernel.
 >  */
 > static int uname(struct utsname *uts)
 > :
 >
 > case WinNT:
 >             sprintf(uts->machine, "i%d86", sysinfo.wProcessorLevel);
 >             break;
 >
 > I guess that wProcessorLevel gives 6 in your case.

Obviously.  But I doubt that wProcessorLevel is what's needed here.
Isn't there something like wProcessorArchitecture that distinguishes
between 32 and 64 bit?

Regards,
  Reinhard

--
------------------------------------------------------------------
Reinhard Kotucha                            Phone: +49-511-3373112
Marschnerstr. 25
D-30167 Hannover                    mailto:reinhard.kotucha at web.de
------------------------------------------------------------------


More information about the dev-luatex mailing list