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

dlclose.3p (4611B)


  1. '\" et
  2. .TH DLCLOSE "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. dlclose
  12. \(em close a symbol table handle
  13. .SH SYNOPSIS
  14. .LP
  15. .nf
  16. #include <dlfcn.h>
  17. .P
  18. int dlclose(void *\fIhandle\fP);
  19. .fi
  20. .SH DESCRIPTION
  21. The
  22. \fIdlclose\fR()
  23. function shall inform the system that the symbol table handle specified by
  24. .IR handle
  25. is no longer needed by the application.
  26. .P
  27. An application writer may use
  28. \fIdlclose\fR()
  29. to make a statement of intent on the part of the process, but this
  30. statement does not create any requirement upon the implementation. When
  31. the symbol table handle is closed, the implementation may unload the
  32. executable object files that were loaded by
  33. \fIdlopen\fR()
  34. when the symbol table handle was opened and those that were loaded by
  35. \fIdlsym\fR()
  36. when using the symbol table handle identified by
  37. .IR handle .
  38. .P
  39. Once a symbol table handle has been closed, an application should assume
  40. that any symbols (function identifiers and data object identifiers)
  41. made visible using
  42. .IR handle ,
  43. are no longer available to the process.
  44. .P
  45. Although a
  46. \fIdlclose\fR()
  47. operation is not required to remove any functions or data objects from
  48. the address space, neither is an implementation prohibited from doing
  49. so. The only restriction on such a removal is that no function nor data
  50. object shall be removed to which references have been relocated, until
  51. or unless all such references are removed. For instance, an executable
  52. object file that had been loaded with a
  53. \fIdlopen\fR()
  54. operation specifying the RTLD_GLOBAL flag might provide a target for
  55. dynamic relocations performed in the processing of other relocatable
  56. objects\(emin such environments, an application may assume that no
  57. relocation, once made, shall be undone or remade unless the executable
  58. object file containing the relocated object has itself been removed.
  59. .SH "RETURN VALUE"
  60. If the referenced symbol table handle was successfully closed,
  61. \fIdlclose\fR()
  62. shall return 0. If
  63. .IR handle
  64. does not refer to an open symbol table handle or if the symbol table
  65. handle could not be closed,
  66. \fIdlclose\fR()
  67. shall return a non-zero value. More detailed diagnostic information
  68. shall be available through
  69. \fIdlerror\fR().
  70. .SH ERRORS
  71. No errors are defined.
  72. .LP
  73. .IR "The following sections are informative."
  74. .SH EXAMPLES
  75. The following example illustrates use of
  76. \fIdlopen\fR()
  77. and
  78. \fIdlclose\fR():
  79. .sp
  80. .RS 4
  81. .nf
  82. #include <dlfcn.h>
  83. int eret;
  84. void *mylib;
  85. \&...
  86. /* Open a dynamic library and then close it ... */
  87. mylib = dlopen("mylib.so", RTLD_LOCAL | RTLD_LAZY);
  88. \&...
  89. eret = dlclose(mylib);
  90. \&...
  91. .fi
  92. .P
  93. .RE
  94. .SH "APPLICATION USAGE"
  95. A conforming application should employ a symbol table handle returned
  96. from a
  97. \fIdlopen\fR()
  98. invocation only within a given scope bracketed by a
  99. \fIdlopen\fR()
  100. operation and the corresponding
  101. \fIdlclose\fR()
  102. operation. Implementations are free to use reference counting or other
  103. techniques such that multiple calls to
  104. \fIdlopen\fR()
  105. referencing the same executable object file may return a pointer to the
  106. same data object as the symbol table handle.
  107. .P
  108. Implementations are also free to re-use a handle. For these reasons,
  109. the value of a handle must be treated as an opaque data type by the
  110. application, used only in calls to
  111. \fIdlsym\fR()
  112. and
  113. \fIdlclose\fR().
  114. .SH RATIONALE
  115. None.
  116. .SH "FUTURE DIRECTIONS"
  117. None.
  118. .SH "SEE ALSO"
  119. .IR "\fIdlerror\fR\^(\|)",
  120. .IR "\fIdlopen\fR\^(\|)",
  121. .IR "\fIdlsym\fR\^(\|)"
  122. .P
  123. The Base Definitions volume of POSIX.1\(hy2017,
  124. .IR "\fB<dlfcn.h>\fP"
  125. .\"
  126. .SH COPYRIGHT
  127. Portions of this text are reprinted and reproduced in electronic form
  128. from IEEE Std 1003.1-2017, Standard for Information Technology
  129. -- Portable Operating System Interface (POSIX), The Open Group Base
  130. Specifications Issue 7, 2018 Edition,
  131. Copyright (C) 2018 by the Institute of
  132. Electrical and Electronics Engineers, Inc and The Open Group.
  133. In the event of any discrepancy between this version and the original IEEE and
  134. The Open Group Standard, the original IEEE and The Open Group Standard
  135. is the referee document. The original Standard can be obtained online at
  136. http://www.opengroup.org/unix/online.html .
  137. .PP
  138. Any typographical or formatting errors that appear
  139. in this page are most likely
  140. to have been introduced during the conversion of the source files to
  141. man page format. To report such errors, see
  142. https://www.kernel.org/doc/man-pages/reporting_bugs.html .