logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

endprotoent.3p (4434B)


  1. '\" et
  2. .TH ENDPROTOENT "3P" 2017 "IEEE/The Open Group" "POSIX Programmer's Manual"
  3. .\"
  4. .SH PROLOG
  5. This manual page is part of the POSIX Programmer's Manual.
  6. The Linux implementation of this interface may differ (consult
  7. the corresponding Linux manual page for details of Linux behavior),
  8. or the interface may not be implemented on Linux.
  9. .\"
  10. .SH NAME
  11. endprotoent,
  12. getprotobyname,
  13. getprotobynumber,
  14. getprotoent,
  15. setprotoent
  16. \(em network protocol database functions
  17. .SH SYNOPSIS
  18. .LP
  19. .nf
  20. #include <netdb.h>
  21. .P
  22. void endprotoent(void);
  23. struct protoent *getprotobyname(const char *\fIname\fP);
  24. struct protoent *getprotobynumber(int \fIproto\fP);
  25. struct protoent *getprotoent(void);
  26. void setprotoent(int \fIstayopen\fP);
  27. .fi
  28. .SH DESCRIPTION
  29. These functions shall retrieve information about protocols. This
  30. information is considered to be stored in a database that can be
  31. accessed sequentially or randomly. The implementation of this database
  32. is unspecified.
  33. .P
  34. The
  35. \fIsetprotoent\fR()
  36. function shall open a connection to the database, and set the next
  37. entry to the first entry. If the
  38. .IR stayopen
  39. argument is non-zero, the connection to the network protocol database
  40. shall not be closed after each call to
  41. \fIgetprotoent\fR()
  42. (either directly, or indirectly through one of the other
  43. .IR getproto* (\|)
  44. functions), and the implementation may maintain an open file descriptor
  45. for the database.
  46. .P
  47. The
  48. \fIgetprotobyname\fR()
  49. function shall search the database from the beginning and find the
  50. first entry for which the protocol name specified by
  51. .IR name
  52. matches the
  53. .IR p_name
  54. member, opening and closing a connection to the database as necessary.
  55. .P
  56. The
  57. \fIgetprotobynumber\fR()
  58. function shall search the database from the beginning and find the
  59. first entry for which the protocol number specified by
  60. .IR proto
  61. matches the
  62. .IR p_proto
  63. member, opening and closing a connection to the database as necessary.
  64. .P
  65. The
  66. \fIgetprotoent\fR()
  67. function shall read the next entry of the database, opening and closing
  68. a connection to the database as necessary.
  69. .P
  70. The
  71. \fIgetprotobyname\fR(),
  72. \fIgetprotobynumber\fR(),
  73. and
  74. \fIgetprotoent\fR()
  75. functions shall each return a pointer to a
  76. .BR protoent
  77. structure, the members of which shall contain the fields of an entry in
  78. the network protocol database.
  79. .P
  80. The
  81. \fIendprotoent\fR()
  82. function shall close the connection to the database, releasing any
  83. open file descriptor.
  84. .P
  85. These functions need not be thread-safe.
  86. .SH "RETURN VALUE"
  87. Upon successful completion,
  88. \fIgetprotobyname\fR(),
  89. \fIgetprotobynumber\fR(),
  90. and
  91. \fIgetprotoent\fR()
  92. return a pointer to a
  93. .BR protoent
  94. structure if the requested entry was found, and a null pointer if the
  95. end of the database was reached or the requested entry was not found.
  96. Otherwise, a null pointer is returned.
  97. .P
  98. The application shall not modify the structure to which the return
  99. value points, nor any storage areas pointed to by pointers within the
  100. structure. The returned pointer, and pointers within the structure,
  101. might be invalidated or the structure or the storage areas might be
  102. overwritten by a subsequent call to
  103. \fIgetprotobyname\fR(),
  104. \fIgetprotobynumber\fR(),
  105. or
  106. \fIgetprotoent\fR().
  107. The returned pointer, and pointers within the structure, might also be
  108. invalidated if the calling thread is terminated.
  109. .SH ERRORS
  110. No errors are defined.
  111. .LP
  112. .IR "The following sections are informative."
  113. .SH "EXAMPLES"
  114. None.
  115. .SH "APPLICATION USAGE"
  116. None.
  117. .SH "RATIONALE"
  118. None.
  119. .SH "FUTURE DIRECTIONS"
  120. None.
  121. .SH "SEE ALSO"
  122. The Base Definitions volume of POSIX.1\(hy2017,
  123. .IR "\fB<netdb.h>\fP"
  124. .\"
  125. .SH COPYRIGHT
  126. Portions of this text are reprinted and reproduced in electronic form
  127. from IEEE Std 1003.1-2017, Standard for Information Technology
  128. -- Portable Operating System Interface (POSIX), The Open Group Base
  129. Specifications Issue 7, 2018 Edition,
  130. Copyright (C) 2018 by the Institute of
  131. Electrical and Electronics Engineers, Inc and The Open Group.
  132. In the event of any discrepancy between this version and the original IEEE and
  133. The Open Group Standard, the original IEEE and The Open Group Standard
  134. is the referee document. The original Standard can be obtained online at
  135. http://www.opengroup.org/unix/online.html .
  136. .PP
  137. Any typographical or formatting errors that appear
  138. in this page are most likely
  139. to have been introduced during the conversion of the source files to
  140. man page format. To report such errors, see
  141. https://www.kernel.org/doc/man-pages/reporting_bugs.html .