OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // This file contains Mojo system handle-related declarations/definitions. | 5 // This file contains Mojo system handle-related declarations/definitions. |
6 // | 6 // |
7 // Note: This header should be compilable as C. | 7 // Note: This header should be compilable as C. |
8 | 8 |
9 #ifndef MOJO_PUBLIC_C_SYSTEM_HANDLE_H_ | 9 #ifndef MOJO_PUBLIC_C_SYSTEM_HANDLE_H_ |
10 #define MOJO_PUBLIC_C_SYSTEM_HANDLE_H_ | 10 #define MOJO_PUBLIC_C_SYSTEM_HANDLE_H_ |
(...skipping 15 matching lines...) Expand all Loading... |
26 // for details about the right(s) required (some, like |MojoClose()|, require no | 26 // for details about the right(s) required (some, like |MojoClose()|, require no |
27 // rights). | 27 // rights). |
28 // |MOJO_HANDLE_RIGHT_NONE| - No rights. | 28 // |MOJO_HANDLE_RIGHT_NONE| - No rights. |
29 // |MOJO_HANDLE_RIGHT_DUPLICATE| - Right to duplicate a handle. | 29 // |MOJO_HANDLE_RIGHT_DUPLICATE| - Right to duplicate a handle. |
30 // |MOJO_HANDLE_RIGHT_TRANSFER| - Right to transfer a handle (e.g., include in | 30 // |MOJO_HANDLE_RIGHT_TRANSFER| - Right to transfer a handle (e.g., include in |
31 // a message). | 31 // a message). |
32 // |MOJO_HANDLE_RIGHT_READ| - Right to "read" from the handle (e.g., read a | 32 // |MOJO_HANDLE_RIGHT_READ| - Right to "read" from the handle (e.g., read a |
33 // message). | 33 // message). |
34 // |MOJO_HANDLE_RIGHT_WRITE| - Right to "write" to the handle (e.g., write a | 34 // |MOJO_HANDLE_RIGHT_WRITE| - Right to "write" to the handle (e.g., write a |
35 // message). | 35 // message). |
36 // |MOJO_HANDLE_RIGHT_EXECUTE| - Right to "execute" using the handle (e.g., | 36 // |MOJO_HANDLE_RIGHT_GET_OPTIONS| - Right to get a handle's options. |
37 // map a buffer as executable code). | 37 // |MOJO_HANDLE_RIGHT_SET_OPTIONS| - Right to set a handle's options. |
38 // | 38 // |
39 // TODO(vtl): Add rights support/checking to existing handle types. | 39 // TODO(vtl): Add rights support/checking to existing handle types. |
40 | 40 |
41 typedef uint32_t MojoHandleRights; | 41 typedef uint32_t MojoHandleRights; |
42 | 42 |
43 #define MOJO_HANDLE_RIGHT_NONE ((MojoHandleRights)0) | 43 #define MOJO_HANDLE_RIGHT_NONE ((MojoHandleRights)0) |
44 #define MOJO_HANDLE_RIGHT_DUPLICATE ((MojoHandleRights)1 << 0) | 44 #define MOJO_HANDLE_RIGHT_DUPLICATE ((MojoHandleRights)1 << 0) |
45 #define MOJO_HANDLE_RIGHT_TRANSFER ((MojoHandleRights)1 << 1) | 45 #define MOJO_HANDLE_RIGHT_TRANSFER ((MojoHandleRights)1 << 1) |
46 #define MOJO_HANDLE_RIGHT_READ ((MojoHandleRights)1 << 2) | 46 #define MOJO_HANDLE_RIGHT_READ ((MojoHandleRights)1 << 2) |
47 #define MOJO_HANDLE_RIGHT_WRITE ((MojoHandleRights)1 << 3) | 47 #define MOJO_HANDLE_RIGHT_WRITE ((MojoHandleRights)1 << 3) |
48 #define MOJO_HANDLE_RIGHT_EXECUTE ((MojoHandleRights)1 << 4) | 48 #define MOJO_HANDLE_RIGHT_GET_OPTIONS ((MojoHandleRights)1 << 4) |
| 49 #define MOJO_HANDLE_RIGHT_SET_OPTIONS ((MojoHandleRights)1 << 5) |
49 | 50 |
50 // |MojoHandleSignals|: Used to specify signals that can be waited on for a | 51 // |MojoHandleSignals|: Used to specify signals that can be waited on for a |
51 // handle (and which can be triggered), e.g., the ability to read or write to | 52 // handle (and which can be triggered), e.g., the ability to read or write to |
52 // the handle. | 53 // the handle. |
53 // |MOJO_HANDLE_SIGNAL_NONE| - No flags. |MojoWait()|, etc. will return | 54 // |MOJO_HANDLE_SIGNAL_NONE| - No flags. |MojoWait()|, etc. will return |
54 // |MOJO_RESULT_FAILED_PRECONDITION| if you attempt to wait on this. | 55 // |MOJO_RESULT_FAILED_PRECONDITION| if you attempt to wait on this. |
55 // |MOJO_HANDLE_SIGNAL_READABLE| - Can read (e.g., a message) from the handle. | 56 // |MOJO_HANDLE_SIGNAL_READABLE| - Can read (e.g., a message) from the handle. |
56 // |MOJO_HANDLE_SIGNAL_WRITABLE| - Can write (e.g., a message) to the handle. | 57 // |MOJO_HANDLE_SIGNAL_WRITABLE| - Can write (e.g., a message) to the handle. |
57 // |MOJO_HANDLE_SIGNAL_PEER_CLOSED| - The peer handle is closed. | 58 // |MOJO_HANDLE_SIGNAL_PEER_CLOSED| - The peer handle is closed. |
58 // |MOJO_HANDLE_SIGNAL_READ_THRESHOLD| - Can read a certain amount of data | 59 // |MOJO_HANDLE_SIGNAL_READ_THRESHOLD| - Can read a certain amount of data |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 // been reached. | 174 // been reached. |
174 // |MOJO_RESULT_BUSY| if |handle| is currently in use in some transaction | 175 // |MOJO_RESULT_BUSY| if |handle| is currently in use in some transaction |
175 // (that, e.g., may result in it being invalidated, such as being sent in | 176 // (that, e.g., may result in it being invalidated, such as being sent in |
176 // a message). | 177 // a message). |
177 MojoResult MojoDuplicateHandle(MojoHandle handle, | 178 MojoResult MojoDuplicateHandle(MojoHandle handle, |
178 MojoHandle* new_handle); // Out. | 179 MojoHandle* new_handle); // Out. |
179 | 180 |
180 MOJO_END_EXTERN_C | 181 MOJO_END_EXTERN_C |
181 | 182 |
182 #endif // MOJO_PUBLIC_C_SYSTEM_HANDLE_H_ | 183 #endif // MOJO_PUBLIC_C_SYSTEM_HANDLE_H_ |
OLD | NEW |