endhostent_r Subroutine

Purpose

Closes the /etc/hosts file.

Library

Standard C Library (libc.a)
(libbind)
(libnis)
(liblocal)

Syntax

#include <netdb.h>
   
void endhostent_r (struct hostent_data *ht_data);

Description

When using the endhostent_r subroutine in DNS/BIND name service resolution, endhostent_r closes the TCP connection which the sethostent_r subroutine set up.

When using the endhostent_r subroutine in NIS name resolution or to search the /etc/hosts file, endhostent_r closes the /etc/hosts file.

Note: If a previous sethostent_r subroutine is performed and the StayOpen parameter does not equal 0, then the endhostent_r subroutine closes the /etc/hosts file. Run a second sethostent_r subroutine with the StayOpen value equal to 0 in order for a following endhostent_r subroutine to succeed. Otherwise, the /etc/hosts file closes on an exit subroutine call .

Parameters

Item Description
ht_data Points to the hostent_data structure

Files

Item Description
/etc/hosts Contains the host name database.
/etc/netsvc.conf Contains the name service ordering.
/usr/include/netdb.h Contains the network database structure.