Open System Services Programmer's Guide
Beginning with the H06.24 and J06.13 RVUs, C/C++ also supports a 64-bit data model, called
LP64. This name indicates that long and pointer data types are 64 bits wide. In this model, int
remains 32 bits wide. The following table shows the size (in bits) for the various C/C++ data types
in the ILP32 and LP64 data models.
Table 50 NonStop ILP32 and LP64 Data Models
LP64ILP32Data Type
88char
1616short
3232int
6432long
6464long long
6432void *
3232enum
6432
1
& (address of)
3232float
6464double
1
This is a 64-bit value if the operand is the address of an object referenced through a 64-bit pointer: &ptr64–>field.
The default data model for native processes is ILP32. Though not explicitly named in this guide for
previous RVUs, this data model has been supported since the inception of TNS/R and TNS/E
native processes.
For information about the C/C++ compiler options that specify the LP64 data model in the OSS,
Windows, and the Guardian environment, see the C/C++ Programmer's Guide for NonStop
Systems in the NTL.
Sharing Memory Between 32-Bit and 64-Bit Processes
Software applications can share data segments between 32-bit and 64-bit processes with these
restrictions:
• Segments can be shared by pin and segment-id, or by filename, using the
SEGMENT_ALLOCATE_ or SEGMENT_ALLOCATE64_Guardian procedures. Segments can
also be shared by shmid, using the shm*() set of OSS functions.
The Guardian and OSS interfaces operate on different segments; a segment created by
SEGMENT_ALLOCATE64_ cannot be shared using shm*() and vice versa.
SEGMENT_ALLOCATE[64]_ supports share-by-file and share-by-pin, which implicitly uses the
same segment-id. shmget() supports share-by-shmid.
• When sharing a segment, the sharers are not required to share it at the same address.
• Shared segments allocated by the shm*() set of OSS APIs are allocated as flat segments.
• Selectable segments can be shared using SEGMENT_ALLOCATE_ and
SEGMENT_ALLOCATE64_, but only as selectable segments, and always at the same address.
• If the segment contains pointers, they should be defined using either the _ptr32 or _ptr64
keyword. If those pointers refer to objects within a shared segment, then the segment should
be mapped at the same address by all sharers.
• Avoid the use of the long data type for declaring data items allocated within the segment,
because the width of long is dependent on the data model (ILP32 or LP64) of the code
accessing that data.
290 64-Bit Support in OSS and Guardian