Open System Services Programmer's Guide

uid_t – For LP64, the uid_t type in /usr/include/sys/types.h, is changed from
long to int.
#ifdef __LP64
typedef int uid_t;
#else
typedef long uid_t;
#endif
size_t – For LP64, the size_t type in /usr/include/sys/types.h, is changed from
unsigned int to unsigned long.
#ifdef __LP64
typedef unsigned long size_t;
#else
typedef unsigned int size_t;
#endif
ssize_t – For LP64, the ssize_t type in /usr/include/sys/types.h, is changed
from int to long.
#ifdef __LP64
typedef long ssize_t;
#else
typedef int ssize_t;
#endif
useconds_t – For LP64, the useconds_t type in /usr/include/sys/types.h, is
changed from unsigned int to unsigned long.
#ifdef __LP64
typedef unsigned long useconds_t;
#else
typedef unsigned int useconds_t;
#endif
OSS Functions with New socklen_t Data Type
The socklen_t data type has been added and arguments for socket functions that previously
used the size_t type now use the socklen_t type, which is unsigned int in both the ILP32
and LP64 data models. The following functions need the socklen_t cast (to suppress a warning)
for LP64 compilations; there is no change for ILP32.
bind()
connect()
setsockopt()
Here is an LP64 example for the bind() function:
if (bind(fd, (const struct sockaddr *)&addr, (socklen_t)sizeof(addr)) < 0 )
...
However, the following functions need more than a cast:
accept()
getpeername()
getsockname()
getsockopt()
These functions require a change in data type, such as the following getsockname() example.
304 64-Bit Support in OSS and Guardian