Closes the /etc/protocols file.
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.
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.
To close the /etc/protocols file:
endprotoent();
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.
/etc/protocols | |
Contains protocol names. |
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.