SC22/WG15 N696 PASC-SEC N636 To: PASC-SEC, WG15 Subject: 1003.1g Problem statement Date: 1996-10-22 (final version) Two problems with the additions to IEEE 1003.1/ISO 9945-1 that have been developed by IEEE project P1003.1g have come to light as a result of work that has been done within X/Open on the introduction of 64-bit architectures into computer systems that support the programming interface defined by IEEE 1003.1/ISO 9945-1. These problems impact on implementations and applications of that interface. 1. POSIX.1g mandates the use of size_t in a number of interfaces and structures where such use is unwarranted and contrary to existing industry practice (BSD, Winsock, etc.) which use int's. This issue has assumed increased importance as the major UNIX vendors move from 32-bit ILP32 platforms to 64-bit LP64 platforms. On ILP32 platforms size_t is the same size as an int so there is no major problems with the use of size_t. However on LP64 platforms size_t is 64 bits whilst int remains at 32 bits. In particular, the use of size_t instead of int for the specified parameter in the following interfaces - accept addresslen - bind addresslen - connect addresslen - getpeername addresslen - getsockname addresslen - getsockopt optlen - recvfrom fromlen - sendto tolen - setsockopt optlen and for the specified members of the following structures - msghdr msg_namelen - msghdr msg_controllen - cmsghdr cmsg_len is unnecessary and adds no value. The unnecessary use of size_t in these interfaces and structures presents significant porting and source management issues for application developers. It also adds to the development costs for those UNIX vendors who wish to support 32-bit binaries on LP64 platforms. We propose that specification of the above listed interface parameters and structure members revert to using ints. 2. Use of long in XTI interfaces creates a binary compatibility issue in 64-bit environments. Since long in 64-bit environments is 64-bit and 32-bit in 32-bit environments, XTI providers will have to provide two sets of XTI libraries and expensive conversion modules to convert structures of one form to another. XTI performance will consequently suffer significant degradation. Redefining long to a 32-bit integral type is not an answer either since it should be possible to implement and conform to the XTI specification only in a 64-bit environment. Therefore, it is proposed that all instances of signed and unsigned longs be respectively changed to an opaque unsigned integral type, t_uscalar_t, and an opaque signed integral type, t_scalar_t. t_scalar_t and t_uscalar_t are equal in length and occupy at least 32-bits. ____________________________________________________________________________ Dr Petr Janecek Apex Plaza, Forbury Road T H E Manager, CAE Development Business Unit Reading, Berkshire O P E N E-Mail: p.janecek@opengroup.org RG1 1AX G R O U P WWW: www.opengroup.org United Kingdom Tel: +44 118 950 8311 x2239 Fax: +44 118 950 0110 ____________________________________________________________________________