Juergen Weber wrote:
Hi,
using the info from http://www.openldap.org/faq/data/cache/719.html I almost got OpenLDAP-2.3.33 to run on z/OS 1.7 with XPLINK and ASCII options.
I used this compiler script acc:
exec /bin/c89 -Wc,LANGLVL(EXTENDED) -Wc,XPLINK,ASCII -Wl,XPLINK -D_XOPEN_SOURCE_EXTENDED=1 -D_OPEN_THREADS -D_OPEN_SYS_SOCK_IPV6 -D_ISOC99_SOURCE $*
I got the server and tools to compile and link (z/OS 1.7). ldapsearch works against IBM's z/OS LDAP server.
The openldap server starts, says it is listening, the bind address is OK (I added some more debug output), but the socket is closed and cannot be connected to.
Have you ever seen this? Actually in daemon.c there seems to be no listen() call, so I wonder if the listen() call fails, I'll have to check tomorrow.
Another source of problems might be that not all headers are included, e.g. daemon.c uses inet_ntop() which requires arpa/inet.h but is not included. I think the ASCII library functions versions are only pulled in if the header is included, so some magic preprocessor tricks that select ascii versions can trigger.
#define _OPEN_SYS_SOCK_IPV6 #include <arpa/inet.h> const char *inet_ntop(int af, const void *src, char *dst, socklen_t size);
As I mentioned previously, <arpa/inet.h> is already included by <ac/socket.h>. There should not be any platform-specific header files included directly in the source files. Also your explicit #define here is redundant since you already included that in the acc script. If <ac/socket.h> is failing to include <arpa/inet.h> then that means the configure script failed to detect that header file, and you should examine config.log to see why it wasn't detected. Or just work around it by manually editing <portable.h> and turning on HAVE_ARPA_INET_H.
You're using a much newer system than I worked on. I don't recall using the _ISOC99_SOURCE switch. Tweaking the language options can have unexpected results with a variety of the header files and libraries...