Open System Services Programmer's Guide
Example 62 getsockname() Data Type Change for LP64
In this example, the current ILP32 code is:
size_t length;
struct sockaddr addr;
getsockname( fd, &addr, &length );
For LP64, the ILP32 code would be changed as follows:
socklen_t length;
struct sockaddr addr;
getsockname( fd, &addr, &length );
Note that the LP64 code would compile and work correctly with the ILP32 data model.
For information about these socket functions, see the Open System Services System Calls Reference
Manual in the NTL.
64-Bit Data Structures Changes and Additions
Beginning with the H06.24 and J06.13 RVUs, the following data structures have been changed.
Some of the structures are changed only for the LP64 data model, which is specified at compile
time. For listings of these data structures, see the corresponding .h file.
• fd_set structure – The fds_bits array type in the fd_set structure in /usr/include/
sys/time.h is changed from long to int.
• flock structure – For LP64, the l_sysid field type in the flock structure in /usr/include/
fcntl.h is changed from long to int.
• flock64 structure – For LP64, the l_sysid field type in the flock64 structure in /usr/
include/fcntl.h is changed from long to int.
• in6_addr structure – For LP64, the sa6_laddr field type in the in6_addr structure in
/usr/include/netinet/in6.h is changed from unsigned long to unsigned int.
• sockaddr_in6 structure – For LP64, the sin6_flowinfo and sin6_scope_id field types
in the sockaddr_in6 structure in /usr/include/netinet/in6.h are changed from
unsigned long to unsigned int.
• process_extension structure – For LP64, there are changes to the process_extension
structure in /usr/include/tdmext.h to allow passing 64-bit pointers and specifying 64-bit
values for the maximum heap size.
• process_launch_parms_ structure – For LP64, there are changes to provide a new 64-bit
version of the process_launch_parms_ structure in /usr/include/dlaunch.h.
• stack_t and sigaction structures – For LP64, there are changes to the stack_t and
sigaction structures in /usr/include/signal.h to allow for 64-bit pointers.
• NSK_stack_t and ucontext_t structures – For LP64, there are changes to the
NSK_stack_t and ucontext_t structures in /usr/include/tdmsig.h to allow for
64-bit pointers.
The following 64-bit data structures have been added, beginning with the H06.24 and J06.13
RVUs.
• iovec64 structure – This new iovec64 structure has the same fields as the iovec structure.
This structure is in /usr/include/sys/uio.h and is used by the new msghdr64 structure.
• msghdr64 structure – This new msghdr64 structure has the same fields as the msghdr
structure. This structure is in /usr/include/sys/socket.h and is used by the new
sendmsg64_() and recvmsg64_() functions.
64-Bit Data Types and Data Structures Changes 305