直接傳一個固定大小的 buffer 可能會因為 size 不夠而產生 Host not resolved 錯誤,
所以要看回傳值, 動態配置大小.
Reference:
http://stackoverflow.com/questions/6517478/how-to-use-gethostbyname-r-in-linux
文章標籤
全站熱搜
部落格全站分類:休閒旅遊
直接傳一個固定大小的 buffer 可能會因為 size 不夠而產生 Host not resolved 錯誤,
所以要看回傳值, 動態配置大小.
Reference:
http://stackoverflow.com/questions/6517478/how-to-use-gethostbyname-r-in-linux