Closes the /etc/protocols file.
Standard C Library (libc.a)
void endprotoent (void)
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.
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.
If a previous setprotoent subroutine has been performed and the StayOpen parameter does not equal 0, 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, type:
endprotoent();
/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.2 Communications Programming Concepts.