getprotobynumber man page on HP-UX

Man page or keyword search:  
man Server   10987 pages
apropos Keyword Search (all sections)
Output format
HP-UX logo
[printable version]

getprotoent(3N)						       getprotoent(3N)

NAME
       getprotoent(),	getprotobynumber(),  getprotobyname(),	setprotoent(),
       endprotoent() - get, set, or end protocol entry

SYNOPSIS
   _XOPEN_SOURCE_EXTENDED only
DESCRIPTION
       The and functions each return a pointer to a structure of type protoent
       containing the broken-out fields of a line in the network protocol data
       base,

       The members of this structure are:

	      The official name of the protocol.

	      A null-terminated list of alternate names for the protocol.

	      The protocol number.

       Functions behave as follows:

	      Reads the next line of the file, opening the file if necessary.

	      Opens and rewinds the file.
				  If the stayopen flag is non-zero, the proto‐
				  col  data base is not closed after each call
				  to (either directly  or  indirectly  through
				  one of the other calls).

	      Closes the file.

	      Each  sequentially searches from the beginning of the file until
	      a matching
				  protocol name	 (among	 either	 the  official
				  names	 or the aliases) or protocol number is
				  found, or until EOF is encountered.

       In a multithreaded application, and use thread-specific storage that is
       re-used	in  each  call.	  The  return  value should be unique for each
       thread and should be saved, if desired, before  the  thread  makes  the
       next call.

       For  enumeration in multithreaded applications, the position within the
       enumeration is a process-wide property shared by all threads.   may  be
       used  in	 a multithreaded application, but resets the enumeration posi‐
       tion for all threads.  enumerates protocol entries: successive calls to
       will  return  either  successive protocol entries or NULL.  If multiple
       threads interleave calls to the threads will enumerate disjoint subsets
       of the protocol database.

       If the system is running the Network Information Service (NIS), and get
       the protocol information	 from  the  NIS	 server	 (see  ypserv(1M)  and
       ypfiles(4)).

   Name Service Switch-Based Operation
       The  library routines and their reentrant counterparts, internally call
       the name service switch to access the "protocols" database lookup  pol‐
       icy  configured	in the file (see nsswitch.conf(4)).  The lookup policy
       defines the order and the criteria of the supported name services  used
       to resolve protocol names and numbers.

RETURN VALUE
       and return a null pointer (0) on EOF or when they are unable to open

OBSOLESCENT INTERFACES
       The  above  reentrant  interfaces  have	been  moved  from  to They are
       included to support existing applications  and  may  be	removed	 in  a
       future  release.	 New multithreaded applications should use the regular
       APIs without

       The reentrant interfaces performs the same operation as	their  regular
       counterpart  (those  without  the  suffix.)   However, and expect to be
       passed the address of a parameter and will store	 the  address  of  the
       result at this supplied parameter.  An additional parameter, an address
       to struct protoent_data, which is defined in the file cannot be a  NULL
       pointer.

       The  reentrant routines return if the operation is unsuccessful, or, in
       the case of if the end of the  services	list  has  been	 reached.   is
       returned otherwise.

EXAMPLES
       The following code excerpt counts the number of protocols entries:

WARNINGS
       Programs	 that  use  the interfaces described in this manpage cannot be
       linked statically because the implementations of these functions employ
       dynamic loading and linking of shared objects at run time.

AUTHOR
       was developed by Sun Microsystems Inc.

FILES
SEE ALSO
       ypserv(1M),	 nsswitch.conf(4),	protocols(4),	   ypfiles(4),
       thread_safety(5).

STANDARDS CONFORMANCE
							       getprotoent(3N)
[top]

List of man pages available for HP-UX

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net