Ngethostbyname_r
Description
È£½ºÆ® À̸§¿¡ ÇØ´çÇÏ´Â IPÁÖ¼Ò¸¦ ¹ÝȯÇÑ´Ù.
Syntax
struct hostent *Ngethostbyname_r(S8 *name, struct hostent *result, S8 *buff, S32 buflen, S32 *errcond)
Parameters
name
È£½ºÆ® À̸§
result
IPÁÖ¼Ò¸¦ °®´Â ±¸Á¶Ã¼
buff
³»ºÎ ¹öÆÛ. Àû¾îµµ 32¹ÙÀÌÆ® ÀÌ»óÀÌ µÇ¾î¾ß ÇÑ´Ù.
buflen
buffÀÇ Å©±â
errcond
¿¡·¯ ÄÚµå
Returns
0
IPÁÖ¼Ò¸¦ ±¸ÇÒ ¼ö ¾ø´Ù.
else
IPÁÖ¼Ò°¡ ¹ÝȯµÇ´Â ±¸Á¶¿¡ µé¾îÀÖ´Ù.
Comments
Hostent ÀÇ ±¸Á¶´Â ´ÙÀ½°ú °°´Ù.
struct hostent {
S8 *h_name; /* name for host */
S8 **h_aliases; /* alias list */
S32 h_addrtype; /* host address type */
S32 h_length; /* length of address*/
S8 **h_addr_list; /* list of addresses */
};
¿¡·¯°¡ ³ °æ¿ì¿¡ errno¿¡ ¿¡·¯ Äڵ尡 ÀúÀåµÈ´Ù. errno´Â Á¤¼öÇüÀÇ ½Ã½ºÅÛ Àü¿ª º¯¼öÀÌ´Ù. ¹ß»ýÇÒ ¼ö ÀÖ´Â ¿¡·¯´Â ´ÙÀ½°ú °°´Ù.
ECONNECTIONDROP ¸ðµ©À̳ª ÇÚµåÆùÀÌ ²÷¾îÁ³À½.
See Also
Ngethostbyname
Example
If ( Ngethostbyname_r("host1", &ht, buff, sizeof(buff), &rc))
memcpy((S8 *)&socka.sin_addr, (S8 *)ht.h_addr_list[0],Iid_SZ);