[ Previous | Next | Contents | Glossary | Home | Search ]
AIX Version 4.3 Communications Technical Reference, Volume 2

setprotoent Subroutine

Purpose

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

Library

Standard C Library (libc.a)

Syntax

#include <netdb.h>
   
void setprotoent (StayOpen)
int StayOpen;

Description

Attention: Do not use the setprotoent subroutine in a multithreaded environment.

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

Parameters

StayOpen 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.

Return Values

The return value points to static data that is overwritten by subsequent calls.

Implementation Specifics

The setprotoent subroutine is part of Base Operating System (BOS) Runtime.

All applications containing the setprotoent subroutine must be compiled with _BSD set to a specific value. Acceptable values are 43 and 44. In addition, all socket applications must include the BSD libbsd.a library.

Files

/etc/protocols Contains the protocol names.

Related Information

The endprotoent subroutine, getprotobyname subroutine, getprotobynumber subroutine, getprotoent subroutine.

Sockets Overview and Understanding Network Address Translation in AIX Version 4.3 Communications Programming Concepts.


[ Previous | Next | Contents | Glossary | Home | Search ]