1
by Francesco Paolo Lovergine
rules: linking manpages-posix not manpages. |
1 |
.\" Copyright (c) 2001-2003 The Open Group, All Rights Reserved |
2
by Francesco Paolo Lovergine
* Alligned to linux main manpages edition. |
2 |
.TH "POSIX_TYPED_MEM_OPEN" P 2003 "IEEE/The Open Group" "POSIX Programmer's Manual" |
1
by Francesco Paolo Lovergine
rules: linking manpages-posix not manpages. |
3 |
.\" posix_typed_mem_open |
4 |
.SH NAME |
|
5 |
posix_typed_mem_open \- open a typed memory object (\fBADVANCED REALTIME\fP) |
|
6 |
.SH SYNOPSIS |
|
7 |
.LP
|
|
8 |
\fB#include <sys/mman.h>
|
|
9 |
.br
|
|
10 |
.sp
|
|
11 |
int posix_typed_mem_open(const char *\fP\fIname\fP\fB, int\fP \fIoflag\fP\fB, |
|
12 |
int\fP \fItflag\fP\fB); \fP |
|
13 |
\fB
|
|
14 |
.br
|
|
15 |
\fP
|
|
16 |
.SH DESCRIPTION |
|
17 |
.LP
|
|
18 |
The \fIposix_typed_mem_open\fP() function shall establish a connection |
|
19 |
between the typed memory object specified by the string |
|
20 |
pointed to by \fIname\fP and a file descriptor. It shall create an |
|
21 |
open file description that refers to the typed memory object |
|
22 |
and a file descriptor that refers to that open file description. The |
|
23 |
file descriptor is used by other functions to refer to that |
|
24 |
typed memory object. It is unspecified whether the name appears in |
|
25 |
the file system and is visible to other functions that take |
|
26 |
pathnames as arguments. The \fIname\fP argument shall conform to the |
|
27 |
construction rules for a pathname. If \fIname\fP begins with |
|
28 |
the slash character, then processes calling \fIposix_typed_mem_open\fP() |
|
29 |
with the same value of \fIname\fP shall refer to the |
|
30 |
same typed memory object. If \fIname\fP does not begin with the slash |
|
31 |
character, the effect is implementation-defined. The |
|
32 |
interpretation of slash characters other than the leading slash character |
|
33 |
in \fIname\fP is implementation-defined. |
|
34 |
.LP
|
|
35 |
Each typed memory object supported in a system shall be identified |
|
36 |
by a name which specifies not only its associated typed |
|
37 |
memory pool, but also the path or port by which it is accessed. That |
|
38 |
is, the same typed memory pool accessed via several different |
|
39 |
ports shall have several different corresponding names. The binding |
|
40 |
between names and typed memory objects is established in an |
|
41 |
implementation-defined manner. Unlike shared memory objects, there |
|
42 |
is no way within IEEE\ Std\ 1003.1-2001 for a program to |
|
43 |
create a typed memory object. |
|
44 |
.LP
|
|
45 |
The value of \fItflag\fP shall determine how the typed memory object |
|
46 |
behaves when subsequently mapped by calls to \fImmap\fP(). At most, |
|
47 |
one of the following flags defined in \fI<sys/mman.h>\fP may be specified: |
|
48 |
.TP 7 |
|
49 |
POSIX_TYPED_MEM_ALLOCATE |
|
50 |
Allocate on \fImmap\fP(). |
|
51 |
.TP 7 |
|
52 |
POSIX_TYPED_MEM_ALLOCATE_CONTIG |
|
53 |
Allocate contiguously on \fImmap\fP(). |
|
54 |
.TP 7 |
|
55 |
POSIX_TYPED_MEM_MAP_ALLOCATABLE |
|
56 |
Map on \fImmap\fP(), without affecting allocatability. |
|
57 |
.sp
|
|
58 |
.LP
|
|
59 |
If \fItflag\fP has the flag POSIX_TYPED_MEM_ALLOCATE specified, any |
|
60 |
subsequent call to \fImmap\fP() using the returned file descriptor |
|
61 |
shall result in allocation and mapping of typed |
|
62 |
memory from the specified typed memory pool. The allocated memory |
|
63 |
may be a contiguous previously unallocated area of the typed |
|
64 |
memory pool or several non-contiguous previously unallocated areas |
|
65 |
(mapped to a contiguous portion of the process address space). |
|
66 |
If \fItflag\fP has the flag POSIX_TYPED_MEM_ALLOCATE_CONTIG specified, |
|
67 |
any subsequent call to \fImmap\fP() using the returned file descriptor |
|
68 |
shall result in allocation and mapping of a single |
|
69 |
contiguous previously unallocated area of the typed memory pool (also |
|
70 |
mapped to a contiguous portion of the process address space). |
|
71 |
If \fItflag\fP has none of the flags POSIX_TYPED_MEM_ALLOCATE or POSIX_TYPED_MEM_ALLOCATE_CONTIG |
|
72 |
specified, any subsequent call to |
|
73 |
\fImmap\fP() using the returned file descriptor shall map an application-chosen |
|
74 |
area from the |
|
75 |
specified typed memory pool such that this mapped area becomes unavailable |
|
76 |
for allocation until unmapped by all processes. If |
|
77 |
\fItflag\fP has the flag POSIX_TYPED_MEM_MAP_ALLOCATABLE specified, |
|
78 |
any subsequent call to \fImmap\fP() using the returned file descriptor |
|
79 |
shall map an application-chosen area from the |
|
80 |
specified typed memory pool without an effect on the availability |
|
81 |
of that area for allocation; that is, mapping such an object |
|
82 |
leaves each byte of the mapped area unallocated if it was unallocated |
|
83 |
prior to the mapping or allocated if it was allocated prior |
|
84 |
to the mapping. The appropriate privilege to specify the POSIX_TYPED_MEM_MAP_ALLOCATABLE |
|
85 |
flag is implementation-defined. |
|
86 |
.LP
|
|
87 |
If successful, \fIposix_typed_mem_open\fP() shall return a file descriptor |
|
88 |
for the typed memory object that is the lowest |
|
89 |
numbered file descriptor not currently open for that process. The |
|
90 |
open file description is new, and therefore the file descriptor |
|
91 |
shall not share it with any other processes. It is unspecified whether |
|
92 |
the file offset is set. The FD_CLOEXEC file descriptor flag |
|
93 |
associated with the new file descriptor shall be cleared. |
|
94 |
.LP
|
|
95 |
The behavior of \fImsync\fP(), \fIftruncate\fP(), and all file operations |
|
96 |
other than \fImmap\fP(), \fIposix_mem_offset\fP(), \fIposix_typed_mem_get_info\fP(), |
|
97 |
\fIfstat\fP(), \fIdup\fP(), \fIdup2\fP(), and \fIclose\fP(), is unspecified |
|
98 |
when passed a |
|
99 |
file descriptor connected to a typed memory object by this function. |
|
100 |
.LP
|
|
101 |
The file status flags of the open file description shall be set according |
|
102 |
to the value of \fIoflag\fP. Applications shall |
|
103 |
specify exactly one of the three access mode values described below |
|
104 |
and defined in the \fI<fcntl.h>\fP header, as the value of \fIoflag\fP. |
|
105 |
.TP 7 |
|
106 |
O_RDONLY |
|
107 |
Open for read access only. |
|
108 |
.TP 7 |
|
109 |
O_WRONLY |
|
110 |
Open for write access only. |
|
111 |
.TP 7 |
|
112 |
O_RDWR |
|
113 |
Open for read or write access. |
|
114 |
.sp
|
|
115 |
.SH RETURN VALUE |
|
116 |
.LP
|
|
117 |
Upon successful completion, the \fIposix_typed_mem_open\fP() function |
|
118 |
shall return a non-negative integer representing the |
|
119 |
lowest numbered unused file descriptor. Otherwise, it shall return |
|
120 |
-1 and set \fIerrno\fP to indicate the error. |
|
121 |
.SH ERRORS |
|
122 |
.LP
|
|
123 |
The \fIposix_typed_mem_open\fP() function shall fail if: |
|
124 |
.TP 7 |
|
125 |
.B EACCES |
|
126 |
The typed memory object exists and the permissions specified by \fIoflag\fP |
|
127 |
are denied. |
|
128 |
.TP 7 |
|
129 |
.B EINTR |
|
130 |
The \fIposix_typed_mem_open\fP() operation was interrupted by a signal. |
|
131 |
.TP 7 |
|
132 |
.B EINVAL |
|
133 |
The flags specified in \fItflag\fP are invalid (more than one of POSIX_TYPED_MEM_ALLOCATE, |
|
134 |
POSIX_TYPED_MEM_ALLOCATE_CONTIG, or |
|
135 |
POSIX_TYPED_MEM_MAP_ALLOCATABLE is specified). |
|
136 |
.TP 7 |
|
137 |
.B EMFILE |
|
138 |
Too many file descriptors are currently in use by this process. |
|
139 |
.TP 7 |
|
140 |
.B ENAMETOOLONG |
|
141 |
The length of the \fIname\fP argument exceeds {PATH_MAX} or a pathname |
|
142 |
component is longer than {NAME_MAX}. |
|
143 |
.TP 7 |
|
144 |
.B ENFILE |
|
145 |
Too many file descriptors are currently open in the system. |
|
146 |
.TP 7 |
|
147 |
.B ENOENT |
|
148 |
The named typed memory object does not exist. |
|
149 |
.TP 7 |
|
150 |
.B EPERM |
|
151 |
The caller lacks the appropriate privilege to specify the flag POSIX_TYPED_MEM_MAP_ALLOCATABLE |
|
152 |
in argument \fItflag\fP. |
|
153 |
.sp
|
|
154 |
.LP
|
|
155 |
\fIThe following sections are informative.\fP |
|
156 |
.SH EXAMPLES |
|
157 |
.LP
|
|
158 |
None. |
|
159 |
.SH APPLICATION USAGE |
|
160 |
.LP
|
|
161 |
None. |
|
162 |
.SH RATIONALE |
|
163 |
.LP
|
|
164 |
None. |
|
165 |
.SH FUTURE DIRECTIONS |
|
166 |
.LP
|
|
167 |
None. |
|
168 |
.SH SEE ALSO |
|
169 |
.LP
|
|
170 |
\fIclose\fP() , \fIdup\fP() , \fIexec\fP() , \fIfcntl\fP() , \fIfstat\fP() |
|
171 |
, |
|
172 |
\fIftruncate\fP() , \fImmap\fP() , \fImsync\fP() , |
|
173 |
\fIposix_mem_offset\fP() , \fIposix_typed_mem_get_info\fP() , \fIumask\fP() |
|
174 |
, the Base |
|
175 |
Definitions volume of IEEE\ Std\ 1003.1-2001, \fI<fcntl.h>\fP, \fI<sys/mman.h>\fP |
|
176 |
.SH COPYRIGHT |
|
177 |
Portions of this text are reprinted and reproduced in electronic form |
|
178 |
from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology |
|
179 |
-- Portable Operating System Interface (POSIX), The Open Group Base |
|
180 |
Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of |
|
181 |
Electrical and Electronics Engineers, Inc and The Open Group. In the |
|
182 |
event of any discrepancy between this version and the original IEEE and |
|
183 |
The Open Group Standard, the original IEEE and The Open Group Standard |
|
184 |
is the referee document. The original Standard can be obtained online at |
|
185 |
http://www.opengroup.org/unix/online.html . |