Sets the state of the protocols table. Format #include <netdb.h> void setprotoent (int stay_open);
1 – Argument
stay_open Specifies a value used to indicate when to reset the protocols table index: o A value of 0 resets the protocols table index after each call to the getprotoent function. o A nonzero value does not reset the protocols table index after each call.
2 – Description
This function sets the index marker to the beginning of the protocols table. Passing a nonzero stay_open argument will allow the index to advance until you call the endprotoent() or exit() function. Related Functions See also endprotoent(), exit(), and getprotoent().
3 – Return Values
1 Indicates success. 0 Indicates an error; unable to access the protocols table.