getdomainname() is failing with errno=14 (bad address) when the test application is built 64bits. The same code works fine when compiled in 32bits. Anybody know how to solve or work around this problem? Where do I search for or file a bug against macosx?
Thanks,
Blade.
Testcase:
Thanks,
Blade.
Testcase:
% cat getdomainname.cxx
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/param.h>
#include <errno.h>
int main(void)
{
char domain[MAXHOSTNAMELEN+1];
int retval = getdomainname(domain, MAXHOSTNAMELEN);
if(retval != 0)
printf("Bad call returns %d with errno %d\n", retval, errno);
else
printf("Domain Name=%s\n", domain);
return 0;
}
% g++ -m64 -g -o getdomainname getdomainname.cxx
%
./getdomainname
Bad call returns -1 with errno 14
% g++ -g -o getdomainname getdomainname.cxx
% ./getdomainname
Domain Name=+mydomain.com