Port on AIX 32bit : unsigned int len; and __ulong32_t socklen_t

REIX, Tony tony.reix at atos.net
Wed Aug 30 09:47:04 EDT 2017


On AIX, in:

the following definition works in 64bit but not in 32bit:
   unsigned int len;
  if (getsockname(sock, (struct sockaddr *)&c_sock, &len) < 0) {

This is due to:
  /opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/6.3.0/include-fixed/sys/socket.h :
  int     getsockname(int, struct sockaddr *__restrict__, socklen_t *__restrict__);
  typedef __ulong32_t socklen_t;
#ifdef __64BIT__
typedef unsigned int    __ulong32_t;
typedef unsigned long   __ulong32_t;
#endif /* __64BIT__ */

I do not know what happens on Linux/x86_64 in 32bit.
I'm looking at Linux/x86_64 now, using krb5-1.15.1-8.fc26.spec.
However I think that it builds by default in 64bit.

  - /root/rpmbuild/BUILD/gcc-7.1.0/fixincludes/tests/base/sys/socket.h
          does not contain any definition for getsockname()
  - __ulong32_t does not seem to exist on Linux.

So: if krb5 on Linux is always built in 64bit, and never in 32bit, the issue does not appear.
However, maybe that, even in 32bit, the issue does not appear. Unless some # if __WORDSIZE == 64  is required ?

Anyway, here is my (simple) patch for AIX.


Tony Reix

Bull - ATOS
IBM Coop Architect & Technical Leader
Office : +33 (0) 4 76 29 72 67
1 rue de Provence - 38432 Échirolles - France
-------------- next part --------------
A non-text attachment was scrubbed...
Name: krb5-1.15.1-sim-unsigned_int_len.patch
Type: text/x-patch
Size: 892 bytes
Desc: krb5-1.15.1-sim-unsigned_int_len.patch
Url : http://mailman.mit.edu/pipermail/krbdev/attachments/20170830/60feb0c1/attachment.bin

More information about the krbdev mailing list