Opens /etc/services file and sets the file marker.
Standard C Library (libc.a)
#include <netdb.h>
void setservent ( StayOpen)
int StayOpen;
The setservent subroutine is threadsafe in AIX® 4.3 and later. However, the return value points to static data that is overwritten by subsequent calls. This data must be copied to be saved for use by subsequent calls.
The setservent subroutine opens the /etc/services file and sets the file marker at the beginning of the file.
All applications containing the setservent subroutine must be compiled with the _BSD macro set to a specific value. Acceptable values are 43 and 44. In addition, all socket applications must include the BSD libbsd.a library.
Item | Description |
---|---|
StayOpen | Indicates when to close the /etc/services file. Specifying a value of 0 closes the file after each call to the getservent subroutine. Specifying a nonzero value allows the file to remain open after each call. |
If an error occurs or the end of the file is reached, the setservent subroutine returns a null pointer.
Item | Description |
---|---|
/etc/services | Contains service names. |