Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

freehostent() - release memory for hostent structure

&pagelevel(3)&pagelevel

#include <netdb.h>

Kernighan-Ritchie-C:
void freehostent(ptr);

struct hostent *ptr;

ANSI-C:
void freehostent(struct hostent* ptr);


Description

The freehostent() function releases memory for an object of the type struct hostent which was requested beforehand with the getipnodebyname() or getipnodebyaddr() function.

The ptr parameter points to an object of the type struct hostent.

The hostent structure is declared as follows:

struct hostent {
   char *h_name;           /* socket host name */
   char **h_aliases;       /* alias list */
   int h_addrtype;         /* address type */
   int h_length;           /* length of address (in bytes) */
   char **h_addr_list;     /* list of addresses for the host */
                           /* terminated with a null pointer */ 
};