Subject: Proposed response to SC22 N2213 (final)

From: Jean Stride <[email-masked]>
Date: 11 Nov 96 10:50:33 EST

Below are the detailed comments on the ballot I asked to
ammend earlier
*****************************************************************

SC22 N2213:  Concurrent PDAM registration and approval ballots for
             ISO/IEC 9945-1 Posix Part 1, Protocol Independent
             Interfaces (PII)

             [IEEE P1003.1g/D6.4;  deadline 1996-12-02]

The UK votes NO, with a recommendation that the implementation
of the changes identified below will be sufficient to convert the UK vote
to YES.

I). Replace the circulated document with SC22/WG15 N697. The document
circulated by SC22 as N2213 describes only the changes to a previous draft; 
N697 is the latest complete IEEE draft of this document.

II). After making the substition described  in I) above, the UK recommends
modifying WG15 N697 as described below.

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 bits 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.

The following specific changes are requested to address 
these problems.

1.1 Definition of type socklen_t
    ----------------------------

On page 147 lines 619-620, change

    the type sa_family_t shall be defined as an unsigned integral 
    type
to

    types socklen_t and sa_family_t shall be defined as unsigned
    integral types

After page 147 line 621, add the following as a new paragraph.

    Type socklen_t shall be an unsigned opaque integral type of
    at least 32 bits. If possible, it should be exactly 32 bits.

1.2 Network address length
    ----------------------

<sys/socket.h>: page 149 line  682
        Change size_t msg_namelen   to  socklen_t msg_namelen 

accept():       page 153 line  826
       change size_t *address_len   to  socklen_t *address_len

bind():         page 155 line  900
       change size_t address_len    to  socklen_t address_len

connect():      page 156 line  949
       change size_t address_len    to  socklen_t address_len

getpeername():  page 159 line 1043
       change size_t *address_len   to  socklen_t *address_len

getsockname():  page 160 line 1074
       change size_t *address_len   to  socklen_t *address_len

recvfrom():     page 164 line 1218
       change size_t *fromlen       to  socklen_t *fromlen

sendto():       page 169 line 1413 
       Change size_t tolen          to  socklen_t tolen

1.3 Option buffer length
    --------------------

getsockopt():   page 161 line 1103
        Change size_t *optlen       to  socklen_t *optlen
 
setsockopt():   page 161 line 1105 
        Change size_t optlen        to  socklen_t optlen

1.4 Msghdr data length
    ------------------

<sys/socket.h>: page 149 line  686
   Change size_t msg_controllen     to  socklen_t msg_controllen

<sys/socket.h>: page 150 line  726
   Change size_t cmsg_len           to  socklen_t cmsg_len

2.1 Use of Options in XTI 
    ---------------------

long-word:             page 316 line  610
        change "long-word" to "t_uscalar_t" 

unsigned longs:        page 316 line  611
        delete line 611.

option buffer diagram: page 317 line  615
        change all instances of "u_long" to "t_uscalar_t".

2.2 Library Functions and Parameters
    --------------------------------

t_getinfo():           page 81 lines 1820-1828
        change all instances of "long" to "t_scalar_t".

t_optmgmt():           page 91 line 2151
        change "long" to "t_scalar_t".

t_optmgmt():           page 94 lines 2292-2297
        change all instances of "unsigned long" to "t_uscalar_t".

t_optmgmt():           page 95 lines 2320 and 2321
        change all instances of "long" to "t_scalar_t".

2.3 xti.h
    -----

Following line 990 on page 59, add the following new section 
4.4.1.1 and re-number the subsections of section 4.4.1
accordingly.

     4.4.1.1 Opaque Integral Types

     When header file <xti.h> is included, types t_scalar_t 
     and t_uscalar_t shall be defined. They shall respectively
     be a signed and unsigned opaque integral type. They shall
     be of equal length of at least 32 bits.

On page 59 line 980, change "4.4.1.24" to "4.4.1.25".

struct t_info:         page 62 lines 1107-1116
        change all instances of "long" to "t_scalar_t".

struct t_opthdr:       page 63 lines 1142-1147
        change all instances of "unsigned long" to "t_uscalar_t".

struct t_optmgmt:      page 64 line  1160
        change "long" to "t_scalar_t".

struct t_linger:       page 67 lines 1284 and 1285
        change "long" to "t_scalar_t".

struct rate:           page 244 lines 1351 and 1352
        change "long" to "t_scalar_t".

struct t_kpalive:      page 256 lines 1769 and 1770
        change "long" to "t_scalar_t".

Add the following after line 7 on page 285

     /*
      * Opaque integral type definitions
      */

            #define t_scalar_t          int32_t
            #define t_uscalar_t         u_int32_t

struct t_info:         page 288 lines 164-172
        change all instances of "long" to "t_scalar_t".

struct t_opthdr:       page 289 lines 197-202
        change all instances of "unsigned long" to "t_uscalar_t".

struct t_optmgmt:      page 289 line  217
        change "long" to "t_scalar_t".

T_ALIGN macro:         page 291 lines 309-310
        change "unsigned long" to "t_uscalar_t".
        change all instances of "long" to "t_scalar_t".

struct t_linger:       page 292 lines 332 and 333
        change "long" to "t_scalar_t".

struct rate:           page 293 lines 366 and 367
        change "long" to "t_scalar_t".

struct t_kpalive:      page 295 lines 445 and 446
        change "long" to "t_scalar_t".

2.4 Appendix A
    ----------

struct t_mosiaddr:     page 227 line 754
        change "unsigned long" to "t_uscalar_t".

struct t_mosiaddr:     page 227 lines 755-756
        change both instances of "long" to "t_scalar_t".

struct t_ap_pco_el:    page 229 lines 838-839
        change both instances of "long" to "t_scalar_t".

struct t_ap_pc_item:   page 229 lines 850-851
        change both instances of "long" to "t_scalar_t".

struct t_ap_syn_off:   page 230 lines 858-859
        change both instances of "long" to "t_scalar_t".

Table A-11:            page 234 lines 981-983
        change all instances of "unsigned long" to "t_uscalar_t".

Table A-12:            page 236 lines 1060-1072
        change all instances of "unsigned long" to "t_uscalar_t".

Table A-13:            page 240 lines 1180-1181 
        change both instances of "unsigned long" to "t_uscalar_t".

Table A-14:            page 240 line 1186
        change "unsigned long" to "t_uscalar_t".

Table A-17:            page 249 lines 1463-1464
        change both instances of "unsigned long" to "t_uscalar_t".

Table A-18:            page 250 line 1509
        change "unsigned long" to "t_uscalar_t".

struct t_mosiaddr:     page 296 line 498
        change "unsigned long" to "t_uscalar_t".

struct t_mosiaddr:     page 296 lines 499-500
        change both instances of "long" to "t_scalar_t".

struct t_ap_pco_el:    page 296 lines 521-522
        change both instances of "long" to "t_scalar_t".

struct t_ap_pc_item:   page 297 lines 528-529
        change both instances of "long" to "t_scalar_t".

struct t_ap_syn_off:   page 297 lines 535-536
        change both instances of "long" to "t_scalar_t".

________________________end of document SC22 N2351 ____________