Opens the /etc/protocols file and sets the file marker.
Standard C Library (libc.a)
#include <netdb.h> int setprotoent_r(StayOpenflag, proto_data); int StayOpenflag; struct protoent_data *proto_data;
The setprotoent_r subroutine opens the /etc/protocols file and sets the file marker to the beginning of the file.
StayOpenflag | Indicates when to close the /etc/protocols
file.
Specifying a value of 0 closes the file after each call to getprotoent. Specifying a nonzero value allows the /etc/protocols file to remain open after each subroutine. |
/etc/protocols | Contains the protocol names. |
endprotoent_r Subroutine, getprotobyname_r Subroutine, getprotobynumber_r Subroutine, and getprotoent_r Subroutine.