setprotoent_r Subroutine

Purpose

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

Library

Standard C Library (libc.a)

Syntax

#include <netdb.h>

int setprotoent_r(StayOpenflag, proto_data);
int StayOpenflag;
struct protoent_data *proto_data;

Description

The setprotoent_r subroutine opens the /etc/protocols file and sets the file marker to the beginning of the file.

Parameters

Item Description
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.

Files

Item Description
/etc/protocols Contains the protocol names.