*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->Tru64 Unix man pages -> getprotobyname (3)              



NAME    [Toc]    [Back]

       getprotobyname, getprotobyname_r - Get a protocol entry by
       protocol name

SYNOPSIS    [Toc]    [Back]

       #include <netdb.h>

       struct protoent *getprotobyname(
               const char *name );

       [Tru64 UNIX]  The following obsolete function is supported
       in  order to maintain backward compatibility with previous
       versions of the operating system.  You should not  use  it
       in new designs.  int getprotobyname_r(
               const char *name,
               struct protoent *proto,
               struct protoent_data *proto_data );

LIBRARY    [Toc]    [Back]

       Standard C Library (libc)

STANDARDS    [Toc]    [Back]

       Interfaces  documented  on  this reference page conform to
       industry standards as follows:

       getprotobyname():  XNS4.0, XNS5.0

       Refer to the standards(5) reference page for more information
 about industry standards and associated tags.

PARAMETERS    [Toc]    [Back]

       Specifies  the  official  protocol  name or alias.  [Tru64
       UNIX]  For  getprotobyname_r(),  points  to  the  protoent
       structure.   The  netdb.h header file defines the protoent
       structure.  [Tru64 UNIX]  For getprotobyname_r(), is  data
       for  the  protocols  database.  The  netdb.h  header  file
       defines the protoent_data structure.

DESCRIPTION    [Toc]    [Back]

       The getprotobyname()  function  returns  a  pointer  to  a
       structure  of  type  protoent. Its members specify data in
       fields from a record line in either the local  /etc/protocols
  file  or the NIS network protocols database file. To
       determine which file or files  to  search,  and  in  which
       order,  the  system uses the switches in the /etc/svc.conf
       file. The netdb.h header file defines the protoent  structure.

       The  getprotobyname() function searches the network protocols
 database file sequentially until  a  match  with  the
       name  parameter  occurs.  The  name parameter will specify
       either the official protocol name or an  alias.  When  EOF
       (End-of-File)  is  reached without a match, an error value
       is returned by this function.

       When using the getprotobyname() function, use the  endprotoent()
 function to close the protocols file.

NOTES    [Toc]    [Back]

       The getprotobyname() function returns a pointer to threadspecific
 data. Subsequent calls to this or a related function
 from the same thread overwrite this data.

       [Tru64  UNIX]  The getprotobyname_r() function is an obsolete
 reentrant version of the  getprotobyname()  function.
       It  is supported in order to maintain backward compatibility
 with previous versions of  the  operating  system  and
       should  not  be  used  in new designs.  Note that you must
       zero-fill the proto_data structure before its first access
       by  either the setprotoent_r() or getprotobyname_r() function.

RETURN VALUES    [Toc]    [Back]

       Upon successful completion, the getprotobyname()  function
       returns a pointer to a protoent structure.  If it fails or
       reaches the end of the network protocols database file, it
       returns a null pointer.

       [Tru64  UNIX]  Upon successful completion, the getprotobyname_r()
 function stores the  protoent  structure  in  the
       location  pointed  to  by  proto, and returns a value of 0
       (zero).  Upon failure, it returns a value of -1.

ERRORS    [Toc]    [Back]

       Current industry standards do not define error values  for
       the getprotobyname() function.

       [Tru64  UNIX]  If  any of the following conditions occurs,
       the getprotobyname_r() function sets errno to  the  corresponding

       The  proto_data or proto parameter is invalid.  The search

       In addition, if the getprotobyname() or getprotobyname_r()
       function  fail to open the file, it sets errno to indicate
       the cause of the failure.

FILES    [Toc]    [Back]

       The Internet network protocols name database  file.   Each
       record  in  the  file occupies a single line and has three
       fields: the official protocol name, the  protocol  number,
       and protocol aliases.  The database service selection configuration

SEE ALSO    [Toc]    [Back]

       Functions:  getprotobynumber(3),  getprotoent(3),  setprotoent(3), endprotoent(3).

       Files: protocols(4), svc.conf(4)

       Networks: nis_intro(7)

       Standards: standards(5)

       Network Programmer's Guide

[ Back ]
 Similar pages
Name OS Title
setprotoent OpenBSD get protocol entry
getprotobynumber FreeBSD get protocol entry
getprotoent Linux get protocol entry
endprotoent NetBSD get protocol entry
getprotobyname FreeBSD get protocol entry
endprotoent FreeBSD get protocol entry
getprotobyname NetBSD get protocol entry
getprotobynumber NetBSD get protocol entry
setprotoent NetBSD get protocol entry
getprotoent_r Tru64 Get a protocol entry
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service