[prev in list] [next in list] [prev in thread] [next in thread]
List: krbdev
Subject: Re: Port on AIX 32bit : unsigned int len; and __ulong32_t socklen_t
From: Robbie Harwood <rharwood () redhat ! com>
Date: 2017-08-30 16:38:53
Message-ID: jlg7exl2eoy.fsf () redhat ! com
[Download RAW message or body]
[Attachment #2 (multipart/signed)]
"REIX, Tony" <tony.reix@atos.net> writes:
> Hi,
>
> On AIX, in:
> src/appl/simple/client/sim_client.c
> src/appl/simple/server/sim_server.c
>
> 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;
> and:
> /usr/include/inttypes.h
> #ifdef __64BIT__
> typedef unsigned int __ulong32_t;
> #else
> 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.
krb5-1.15.1 builds fine on both 32 and 64-bit Linux. POSIX[1] states:
<sys/socket.h> makes available a type, socklen_t, which is an
unsigned opaque integral type of length of at least 32 bits. To
forestall portability problems, it is recommended that applications
should not use values larger than 2^32 - 1.
> Moreover:
> - /root/rpmbuild/BUILD/gcc-7.1.0/fixincludes/tests/base/sys/socket.h
> does not contain any definition for getsockname()
I would expect that to be at /usr/include/sys/socket.h on Fedora, and
it's declared as:
/* Put the local address of FD into *ADDR and its length in *LEN. */
extern int getsockname (int __fd, __SOCKADDR_ARG __addr,
socklen_t *__restrict __len) __THROW;
(It comes out of the glibc-headers package.)
> 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 ?
krb5 has abstraction around getsockname's third type. The #define to
look for is GETSOCKNAME_ARG3_TYPE; there are some rules in aclocal.m4
for determining it.
Thanks,
--Robbie
["signature.asc" (application/pgp-signature)]
_______________________________________________
krbdev mailing list krbdev@mit.edu
https://mailman.mit.edu/mailman/listinfo/krbdev
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic