直接傳一個固定大小的 buffer 可能會因為 size 不夠而產生 Host not resolved 錯誤,

所以要看回傳值, 動態配置大小.

Reference:

http://stackoverflow.com/questions/6517478/how-to-use-gethostbyname-r-in-linux

arrow
arrow
    全站熱搜

    kk 發表在 痞客邦 留言(0) 人氣()