| Shyam --
Hopefully this note will answer your questions. If not, please
reference problem 1997-3211 for further follow-up. If you have new
issues, however, they should be logged as a new problem.
1. How does the 64 bit architecture affect the system macros like
'sizeof(int)'?
Digital UNIX on Alpha uses 64 bit addresses. This does not dictate the
size of data. As you noticed, the size of an integer is 4 bytes. If
you printed out the size of theh ADDRESS of an integer, you would have
found it to be 8 bytes.
sizeof() will correctly return the size of the item specified -- just
make sure you specify the correct item!
2. Our application programs make use of standard macros such as 'sizeof'
for computing sizes of integers and pointers. These programs are
working on 32 bit Operating Systems (such as SunOS4.1.4 and Solaris 2.4,
and HP-UX 9.x). Can I assume, that these source files get compiled and
work well on Digital UNIX also?
As stated above, sizeof() will give you the size of the datum (measured
in bytes). As long as you don't do things like attempt to store an
address (8 bytes) into an integer (4 bytes) you'll be okay.
3. What precautions do we need to take while reading kernel data
structures from /dev/kmem?
As noted in the man pages, there is a restriction when attempting to
modify /dev/kmem, in that modifications should be to whole quadwords.
Other cases need to be protected by LDQ_L/STQ_C operations.
I don't see where any precautions around reading need to be taken.
4. What precautions do I need to take while data is being transferred
over TCP/IP sockets from a 32 bit O.S (Solaris) to Digital UNIX?
Your concerns in this area will be more likely related to the byte order
of data.
Note that Digital UNIX on the Alpha is little-endian, while Solaris is
big-endian. You may use htonl() and friends to ensure proper byte
order.
|