64비트에서 inet_ntoa 함수가 동작을 하지 않는것 같습니다.
글쓴이: ftfuture / 작성시간: 화, 2007/04/10 - 6:36오후
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <signal.h>
#include <time.h>
#include <sys/time.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <fcntl.h>
int main(int argc, char *argv[])
{
struct in_addr in;
struct in_addr inp;
char strBuff[20];
inet_aton("200.200.200.200", &inp);
//memcpy(&in, &inp, 8);
strcpy( strBuff, (char *)inet_ntoa(inp));
printf("ip : %s\n", strBuff);
return 0;
}위코드로 테스트했는데요.. 32bit 머신에서는 잘 됩니다만.. 64bit 머신에서는 segment fault 를 뱃습니다..
아예 지원을 안하는건지 ^^:
Forums:


댓글 달기