Opens /etc/services file and sets the file marker.
Standard C Library (libc.a)
#include <netdb.h>
int setservent_r(StayOpenflag, serv_data)
int StayOpenflag;
struct servent_data serv_data;
The setservent_r subroutine opens the /etc/services file and sets the file marker at the beginning of the file.
| Item | Description |
|---|---|
| StayOpenflag | 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. |
| serv_data | Points to the servent_data structure. |
| Item | Description |
|---|---|
| /etc/services | Contains service names. |