Host introspection: Difference between revisions
Content added Content deleted
(→{{header|Perl}}: Switch from 'intsize' to 'uvsize', because 'byteorder' reports the byte order in a UV, and I want the size to match the byte order.) |
(→{{header|Pascal}}: add example) |
||
Line 467: | Line 467: | ||
Same methods can be used to get the results of commands lshw, dmidecode... |
Same methods can be used to get the results of commands lshw, dmidecode... |
||
=={{header|Pascal}}== |
|||
<lang pascal>program HostIntrospection(output); |
|||
begin |
|||
writeln('Pointer size: ', SizeOf(Pointer), ' byte, i.e. ', SizeOf(Pointer)*8, ' bit.'); |
|||
{ NtoBE converts from native endianess to big endianess } |
|||
if 23453 = NtoBE(23453) then |
|||
writeln('This host is big endian.') |
|||
else |
|||
writeln('This host is little endian.'); |
|||
end.</lang> |
|||
Output: |
|||
<pre> |
|||
>: ./HostIntrospection |
|||
Pointer size: 4 byte, i.e. 32 bit. |
|||
This host is little endian. |
|||
</pre> |
|||
=={{header|Perl}}== |
=={{header|Perl}}== |