|
1 /** @file ../include/sys/ipc.h |
|
2 @internalComponent |
|
3 */ |
|
4 |
|
5 /** @fn ftok(const char *pathname, int proj_id) |
|
6 @param pathname |
|
7 @param proj_id |
|
8 @return The ftok function will return -1 if pathname does not exist or if it cannot be accessed by the calling process. |
|
9 On success the generated key_t value is returned. |
|
10 |
|
11 The ftok function attempts to create a unique key suitable for use with the msgget , semget and shmget functions given the pathname of an existing file and a user-selectable id. |
|
12 |
|
13 The specified pathname must specify an existing file that is accessible to the calling process |
|
14 or the call will fail. |
|
15 Also, note that links to files will return the |
|
16 same key, given the same id. |
|
17 |
|
18 Examples: |
|
19 @code |
|
20 #include <sys/types.h> |
|
21 #include <sys/ipc.h> |
|
22 #include <stdio.h> |
|
23 |
|
24 int main(void) |
|
25 { |
|
26 char *pathame = "C:\XXX"; |
|
27 int proj_id = 100; |
|
28 key_t fkey; |
|
29 if ((fkey = ftok(pathame, proj_id)) == -1) { |
|
30 printf("ftok() failed |
|
31 "); |
|
32 } |
|
33 return 0; |
|
34 } |
|
35 |
|
36 @endcode |
|
37 @see semget() |
|
38 @see shmget() |
|
39 @see msgget() |
|
40 |
|
41 |
|
42 |
|
43 @capability Deferred @ref RFs::Entry(const TDesC16&, TEntry&) |
|
44 |
|
45 @publishedAll |
|
46 @externallyDefinedApi |
|
47 */ |
|
48 |
|
49 |
|
50 /** @struct ipc_perm |
|
51 |
|
52 To store information needed in determining permissions to perform an ipc operation. |
|
53 |
|
54 @publishedAll |
|
55 @externallyDefinedApi |
|
56 */ |
|
57 |
|
58 /** @var ipc_perm::cuid |
|
59 creator user id |
|
60 */ |
|
61 |
|
62 /** @var ipc_perm::cgid |
|
63 creator group id |
|
64 */ |
|
65 |
|
66 /** @var ipc_perm::uid |
|
67 user id |
|
68 */ |
|
69 |
|
70 /** @var ipc_perm::gid |
|
71 group id |
|
72 */ |
|
73 |
|
74 /** @var ipc_perm::mode |
|
75 rw permission |
|
76 */ |
|
77 |
|
78 /** @var ipc_perm::seq |
|
79 sequence X (to generate unique ipcid) |
|
80 */ |
|
81 |
|
82 /** @var ipc_perm::key |
|
83 user specified msg or sem or shm key |
|
84 */ |
|
85 |
|
86 |
|
87 /** @def IPC_CREAT |
|
88 |
|
89 SVID required constants (same values as system 5). create entry if key does not exist. |
|
90 |
|
91 @publishedAll |
|
92 @externallyDefinedApi |
|
93 */ |
|
94 |
|
95 /** @def IPC_EXCL |
|
96 |
|
97 SVID required constants (same values as system 5). fail if key exists. |
|
98 |
|
99 @publishedAll |
|
100 @externallyDefinedApi |
|
101 */ |
|
102 |
|
103 /** @def IPC_NOWAIT |
|
104 |
|
105 SVID required constants (same values as system 5). error if request must wait. |
|
106 |
|
107 @publishedAll |
|
108 @externallyDefinedApi |
|
109 */ |
|
110 |
|
111 /** @def IPC_PRIVATE |
|
112 |
|
113 private key |
|
114 |
|
115 @publishedAll |
|
116 @externallyDefinedApi |
|
117 */ |
|
118 |
|
119 /** @def IPC_RMID |
|
120 |
|
121 remove identifier |
|
122 |
|
123 @publishedAll |
|
124 @externallyDefinedApi |
|
125 */ |
|
126 |
|
127 /** @def IPC_SET |
|
128 |
|
129 set options |
|
130 |
|
131 @publishedAll |
|
132 @externallyDefinedApi |
|
133 */ |
|
134 |
|
135 |
|
136 /** @def IPC_STAT |
|
137 |
|
138 get options |
|
139 |
|
140 @publishedAll |
|
141 @externallyDefinedApi |
|
142 */ |
|
143 |
|
144 |
|
145 |
|
146 |
|
147 |
|
148 |
|
149 |
|
150 |
|
151 |
|
152 |
|
153 |
|
154 |
|
155 |