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

posix_mem_offset.3p (3876B)


  1. '\" et
  2. .TH POSIX_MEM_OFFSET "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. posix_mem_offset
  12. \(em find offset and length of a mapped typed memory block
  13. (\fBADVANCED REALTIME\fP)
  14. .SH SYNOPSIS
  15. .LP
  16. .nf
  17. #include <sys/mman.h>
  18. .P
  19. int posix_mem_offset(const void *restrict \fIaddr\fP, size_t \fIlen\fP,
  20. off_t *restrict \fIoff\fP, size_t *restrict \fIcontig_len\fP,
  21. int *restrict \fIfildes\fP);
  22. .fi
  23. .SH DESCRIPTION
  24. The
  25. \fIposix_mem_offset\fR()
  26. function shall return in the variable pointed to by
  27. .IR off
  28. a value that identifies the offset (or location), within a memory
  29. object, of the memory block currently mapped at
  30. .IR addr .
  31. The function shall return in the variable pointed to by
  32. .IR fildes ,
  33. the descriptor used (via
  34. \fImmap\fR())
  35. to establish the mapping which contains
  36. .IR addr .
  37. If that descriptor was closed since the mapping was established, the
  38. returned value of
  39. .IR fildes
  40. shall be \-1. The
  41. .IR len
  42. argument specifies the length of the block of the memory object the
  43. user wishes the offset for; upon return, the value pointed to by
  44. .IR contig_len
  45. shall equal either
  46. .IR len ,
  47. or the length of the largest contiguous block of the memory object that
  48. is currently mapped to the calling process starting at
  49. .IR addr ,
  50. whichever is smaller.
  51. .P
  52. If the memory object mapped at
  53. .IR addr
  54. is a typed memory object, then if the
  55. .IR off
  56. and
  57. .IR contig_len
  58. values obtained by calling
  59. \fIposix_mem_offset\fR()
  60. are used in a call to
  61. \fImmap\fR()
  62. with a file descriptor that refers to the same memory pool as
  63. .IR fildes
  64. (either through the same port or through a different port), and that
  65. was opened with neither the POSIX_TYPED_MEM_ALLOCATE nor the
  66. POSIX_TYPED_MEM_ALLOCATE_CONTIG flag,
  67. the typed memory area that is mapped shall be exactly the same area
  68. that was mapped at
  69. .IR addr
  70. in the address space of the process that called
  71. \fIposix_mem_offset\fR().
  72. .P
  73. If the memory object specified by
  74. .IR fildes
  75. is not a typed memory object, then the behavior of this function is
  76. implementation-defined.
  77. .SH "RETURN VALUE"
  78. Upon successful completion, the
  79. \fIposix_mem_offset\fR()
  80. function shall return zero; otherwise, the corresponding error status
  81. value shall be returned.
  82. .SH ERRORS
  83. The
  84. \fIposix_mem_offset\fR()
  85. function shall fail if:
  86. .TP
  87. .BR EACCES
  88. The process has not mapped a memory object supported by this function
  89. at the given address
  90. .IR addr .
  91. .P
  92. This function shall not return an error code of
  93. .BR [EINTR] .
  94. .LP
  95. .IR "The following sections are informative."
  96. .SH EXAMPLES
  97. None.
  98. .SH "APPLICATION USAGE"
  99. None.
  100. .SH RATIONALE
  101. None.
  102. .SH "FUTURE DIRECTIONS"
  103. None.
  104. .SH "SEE ALSO"
  105. .IR "\fImmap\fR\^(\|)",
  106. .IR "\fIposix_typed_mem_open\fR\^(\|)"
  107. .P
  108. The Base Definitions volume of POSIX.1\(hy2017,
  109. .IR "\fB<sys_mman.h>\fP"
  110. .\"
  111. .SH COPYRIGHT
  112. Portions of this text are reprinted and reproduced in electronic form
  113. from IEEE Std 1003.1-2017, Standard for Information Technology
  114. -- Portable Operating System Interface (POSIX), The Open Group Base
  115. Specifications Issue 7, 2018 Edition,
  116. Copyright (C) 2018 by the Institute of
  117. Electrical and Electronics Engineers, Inc and The Open Group.
  118. In the event of any discrepancy between this version and the original IEEE and
  119. The Open Group Standard, the original IEEE and The Open Group Standard
  120. is the referee document. The original Standard can be obtained online at
  121. http://www.opengroup.org/unix/online.html .
  122. .PP
  123. Any typographical or formatting errors that appear
  124. in this page are most likely
  125. to have been introduced during the conversion of the source files to
  126. man page format. To report such errors, see
  127. https://www.kernel.org/doc/man-pages/reporting_bugs.html .