[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Technical Reference: Communications, Volume 2

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

ht_data Points to the hostent_data structure

Files

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

Related Information

gethostbyaddr_r Subroutine, gethostbyname_r Subroutine, sethostent_r Subroutine, andgethostent_r Subroutine.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]