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

Technical Reference: Communications, Volume 2


endprotoent Subroutine

Purpose

Closes the /etc/protocols file.

Library

Standard C Library (libc.a)

Syntax

Description

The endprotoent subroutine closes the /etc/protocols file.

Calls made to the getprotoent subroutine, getprotobyname subroutine, or getprotobynumber subroutine open the /etc/protocols file. An application program can use the endprotoent subroutine to close the /etc/protocols file.

Return Values

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

Examples

To close the /etc/protocols file:

endprotoent();

Implementation Specifics

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

All applications containing the endprotoent 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/protocols
                          Contains protocol names.

Related Information

The exit subroutine, getprotobynumber subroutine, getprotobyname subroutine, getprotoent subroutine, setprotoent subroutine.

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


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