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

Technical Reference: Communications, Volume 2


endnetent Subroutine

Purpose

Closes the /etc/networks file.

Library

Standard C Library (libc.a)

Syntax

#include <netdb.h>

void endnetent ( )

Description

The endnetent subroutine closes the /etc/networks file. Calls made to the getnetent, getnetbyaddr, or getnetbyname subroutine open the /etc/networks file.

Return Values

If a previous setnetent subroutine has been performed and the StayOpen parameter does not equal 0, then the endnetent subroutine will not close the /etc/networks file. Also, the setnetent subroutine does not indicate that it closed the file. A second setnetent subroutine has to be issued with the StayOpen parameter equal to 0 in order for a following endnetent subroutine to succeed. If this is not done, the /etc/networks file must be closed with the exit subroutine.

Examples

To close the /etc/networks file:

endnetent();

Implementation Specifics

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

All applications containing the endnetent subroutine must be compiled with _BSD set to a specific value. Acceptable values are 43 and 44. In addition, all socket applications must include the BSD libbsd.a library.

Files


/etc/networks
                          Contains official network names.

Related Information

The exit subroutine, getnetbyaddr subroutine, getnetbyname subroutine, getnetent subroutine, setnetent subroutine.

Sockets Overview, Understanding Network Address Translation, and List of Socket Programming References in AIX 5L Version 5.1 Communications Programming Concepts.


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