1POSIX_MEM_OFFSET(3P) POSIX Programmer's Manual POSIX_MEM_OFFSET(3P)
2
3
4
6 This manual page is part of the POSIX Programmer's Manual. The Linux
7 implementation of this interface may differ (consult the corresponding
8 Linux manual page for details of Linux behavior), or the interface may
9 not be implemented on Linux.
10
12 posix_mem_offset - find offset and length of a mapped typed memory
13 block (ADVANCED REALTIME)
14
16 #include <sys/mman.h>
17
18 int posix_mem_offset(const void *restrict addr, size_t len,
19 off_t *restrict off, size_t *restrict contig_len,
20 int *restrict fildes);
21
22
24 The posix_mem_offset() function shall return in the variable pointed to
25 by off a value that identifies the offset (or location), within a mem‐
26 ory object, of the memory block currently mapped at addr. The function
27 shall return in the variable pointed to by fildes, the descriptor used
28 (via mmap()) to establish the mapping which contains addr. If that
29 descriptor was closed since the mapping was established, the returned
30 value of fildes shall be -1. The len argument specifies the length of
31 the block of the memory object the user wishes the offset for; upon
32 return, the value pointed to by contig_len shall equal either len, or
33 the length of the largest contiguous block of the memory object that is
34 currently mapped to the calling process starting at addr, whichever is
35 smaller.
36
37 If the memory object mapped at addr is a typed memory object, then if
38 the off and contig_len values obtained by calling posix_mem_offset()
39 are used in a call to mmap() with a file descriptor that refers to the
40 same memory pool as fildes (either through the same port or through a
41 different port), and that was opened with neither the
42 POSIX_TYPED_MEM_ALLOCATE nor the POSIX_TYPED_MEM_ALLOCATE_CONTIG flag,
43 the typed memory area that is mapped shall be exactly the same area
44 that was mapped at addr in the address space of the process that called
45 posix_mem_offset().
46
47 If the memory object specified by fildes is not a typed memory object,
48 then the behavior of this function is implementation-defined.
49
51 Upon successful completion, the posix_mem_offset() function shall
52 return zero; otherwise, the corresponding error status value shall be
53 returned.
54
56 The posix_mem_offset() function shall fail if:
57
58 EACCES The process has not mapped a memory object supported by this
59 function at the given address addr.
60
61
62 This function shall not return an error code of [EINTR].
63
64 The following sections are informative.
65
67 None.
68
70 None.
71
73 None.
74
76 None.
77
79 mmap(), posix_typed_mem_open(), the Base Definitions volume of
80 IEEE Std 1003.1-2001, <sys/mman.h>
81
83 Portions of this text are reprinted and reproduced in electronic form
84 from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
85 -- Portable Operating System Interface (POSIX), The Open Group Base
86 Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
87 Electrical and Electronics Engineers, Inc and The Open Group. In the
88 event of any discrepancy between this version and the original IEEE and
89 The Open Group Standard, the original IEEE and The Open Group Standard
90 is the referee document. The original Standard can be obtained online
91 at http://www.opengroup.org/unix/online.html .
92
93
94
95IEEE/The Open Group 2003 POSIX_MEM_OFFSET(3P)