Page MenuHome GnuPG

Building libassuan on AIX warns about missing function declarations.
Open, NormalPublic

Description

After running ./configure && make on AIX:

assuan-socket-server.c: In function 'accept_connection_bottom':
assuan-socket-server.c:134:9: warning: implicit declaration of function 'getpeereid'; did you mean 'getpgid'? [-Wimplicit-function-declaration]
  134 |     if (getpeereid (fd, &ctx->peercred.uid, &ctx->peercred.gid) != -1)
      |         ^~~~~~~~~~
      |         getpgid

This platform needs _ALL_SOURCE defined for this function.

Event Timeline

Correction, the _ALL_SOURCE definition only applies if __cplusplus is defined... Strange platform...

werner triaged this task as Normal priority.Mon, May 5, 11:13 AM
werner added a subscriber: werner.

But the function works and returns the peer's credentials?

Yep, I wrote a small client and server just to verify that it is functional.

Here is the result of calling getpeerid on the socket from accept:

$ ./server 
uid: 11013, gid: 1, message: hello
`

Here is the user that I have on that system:

$ id 
uid=11013(collinfunk) gid=1(staff) groups=1(staff)

I use GCC cfarm for testing AIX by the way, since AIX would be hard to use otherwise [1]. If you ever have the need to test there.

The AIX machine is provided by OSU though, and since the current US president hates colleges, it will likely be gone soon [2]. :(

[1] https://portal.cfarm.net/
[2] https://osuosl.org/blog/osl-future/