![]() Chapter Contents  | 
![]() Previous  | 
![]() Next  | 
| getnetent | 
| Portability: | UNIX compatible | 
| SYNOPSIS | |
| DESCRIPTION | |
| RETURN VALUE | |
| CAUTION | |
| PORTABILITY | |
| IMPLEMENTATION | |
| RELATED FUNCTIONS | 
| SYNOPSIS | 
#include <netdb.h> struct netent *getnetent(void);
| DESCRIPTION | 
Given a network name, 
getnetent
 returns a pointer to the next network
entry in the 
netent
 structure
as defined in 
<netdb.h>
.
The source of the data in this structure is the network file, that is, a file
with the same format as the 
/etc/networks
 file on a UNIX operating system. Refer to <netdb.h> for details on the 
netent
structure.
Refer to Search Logic for information on the logic used to determine the location of the network file.
| RETURN VALUE | 
If 
getnetent
 succeeds, it returns a pointer to the 
netent
 structure. A null pointer indicates an
error occurred or there were no more network entries.
| CAUTION | 
The value that 
getnetent
 returns points to a static structure within the library.
 You must copy the information from this structure before you make further 
getnetbyname
, 
getnetbyaddr
, or 
getnetent
 calls.
| PORTABILITY | 
getnetent
 is portable to other environments, including most UNIX systems,
that implement BSD sockets.
| IMPLEMENTATION | 
getnetent
 is ported directly from the BSD UNIX Socket Library.
| RELATED FUNCTIONS | 
getnetbyaddr
, 
getnetbyname
, 
setnetent
, 
endnetent
![]() Chapter Contents  | 
![]() Previous  | 
![]() Next  | 
![]() Top of Page  | 
Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.