Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

bdoyle

macrumors newbie
Original poster
Nov 6, 2008
6
0
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:
% 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
 

bdoyle

macrumors newbie
Original poster
Nov 6, 2008
6
0
Thanks for the suggestion. I just tried it but no luck. ;( No help from Apple support either. :mad:
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.