setservent_r Subroutine

Purpose

Opens /etc/services file and sets the file marker.

Library

Standard C Library (libc.a)

Syntax

#include <netdb.h>

int setservent_r(StayOpenflag, serv_data) 
int StayOpenflag;
struct servent_data serv_data;

Description

The setservent_r subroutine opens the /etc/services file and sets the file marker at the beginning of the file.

Parameters

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.

Files

Item Description
/etc/services Contains service names.