[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]
Communications Technical Reference, Volume 2

endhostent Subroutine

Purpose

Closes the /etc/hosts file.

Library

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

Syntax

#include <netdb.h>
    
endhostent ()

Description

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

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

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

Implementation Specifics

The endhostent subroutine is part of Base Operating System (BOS) Runtime.

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

The gethostbyaddr subroutine, gethostbyname subroutine, sethostent subroutine gethostent subroutine.

Sockets Overview and Network Address Translation in AIX Version 4.3 Communications Programming Concepts.


[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]