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