OLD | NEW |
1 // Copyright 2014 The Crashpad Authors. All rights reserved. | 1 // Copyright 2014 The Crashpad Authors. All rights reserved. |
2 // | 2 // |
3 // Licensed under the Apache License, Version 2.0 (the "License"); | 3 // Licensed under the Apache License, Version 2.0 (the "License"); |
4 // you may not use this file except in compliance with the License. | 4 // you may not use this file except in compliance with the License. |
5 // You may obtain a copy of the License at | 5 // You may obtain a copy of the License at |
6 // | 6 // |
7 // http://www.apache.org/licenses/LICENSE-2.0 | 7 // http://www.apache.org/licenses/LICENSE-2.0 |
8 // | 8 // |
9 // Unless required by applicable law or agreed to in writing, software | 9 // Unless required by applicable law or agreed to in writing, software |
10 // distributed under the License is distributed on an "AS IS" BASIS, | 10 // distributed under the License is distributed on an "AS IS" BASIS, |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 //! Callers can use this function in preference to `mach_thread_self()`. This | 60 //! Callers can use this function in preference to `mach_thread_self()`. This |
61 //! function returns an extant reference to the current thread’s port without | 61 //! function returns an extant reference to the current thread’s port without |
62 //! incrementing its reference count. | 62 //! incrementing its reference count. |
63 //! | 63 //! |
64 //! \return The value of `mach_thread_self()` without incrementing its reference | 64 //! \return The value of `mach_thread_self()` without incrementing its reference |
65 //! count. The returned port must not be deallocated by | 65 //! count. The returned port must not be deallocated by |
66 //! `mach_port_deallocate()`. The returned value is valid as long as the | 66 //! `mach_port_deallocate()`. The returned value is valid as long as the |
67 //! thread continues to exist as a `pthread_t`. | 67 //! thread continues to exist as a `pthread_t`. |
68 thread_t MachThreadSelf(); | 68 thread_t MachThreadSelf(); |
69 | 69 |
| 70 //! \brief Creates a new Mach port in the current task. |
| 71 //! |
| 72 //! This function wraps the `mach_port_allocate()` providing a simpler |
| 73 //! interface. |
| 74 //! |
| 75 //! \param[in] right The type of right to create. |
| 76 //! |
| 77 //! \return The new Mach port. On failure, `MACH_PORT_NULL` with a message |
| 78 //! logged. |
| 79 mach_port_t NewMachPort(mach_port_right_t right); |
| 80 |
70 //! \brief The value for `EXC_MASK_ALL` appropriate for the operating system at | 81 //! \brief The value for `EXC_MASK_ALL` appropriate for the operating system at |
71 //! run time. | 82 //! run time. |
72 //! | 83 //! |
73 //! The SDK’s definition of `EXC_MASK_ALL` has changed over time, with later | 84 //! The SDK’s definition of `EXC_MASK_ALL` has changed over time, with later |
74 //! versions containing more bits set than earlier versions. However, older | 85 //! versions containing more bits set than earlier versions. However, older |
75 //! kernels will reject exception masks that contain bits set that they don’t | 86 //! kernels will reject exception masks that contain bits set that they don’t |
76 //! recognize. Calling this function will return a value for `EXC_MASK_ALL` | 87 //! recognize. Calling this function will return a value for `EXC_MASK_ALL` |
77 //! appropriate for the system at run time. | 88 //! appropriate for the system at run time. |
78 //! | 89 //! |
79 //! \note `EXC_MASK_ALL` does not include the value of `EXC_MASK_CRASH`. | 90 //! \note `EXC_MASK_ALL` does not include the value of `EXC_MASK_CRASH`. |
80 //! Consumers that want `EXC_MASK_ALL` along with `EXC_MASK_CRASH` must use | 91 //! Consumers that want `EXC_MASK_ALL` along with `EXC_MASK_CRASH` must use |
81 //! ExcMaskAll() | `EXC_MASK_CRASH` explicitly. | 92 //! ExcMaskAll() | `EXC_MASK_CRASH` explicitly. |
82 exception_mask_t ExcMaskAll(); | 93 exception_mask_t ExcMaskAll(); |
83 | 94 |
84 } // namespace crashpad | 95 } // namespace crashpad |
85 | 96 |
86 #endif // CRASHPAD_UTIL_MACH_MACH_EXTENSIONS_H_ | 97 #endif // CRASHPAD_UTIL_MACH_MACH_EXTENSIONS_H_ |
OLD | NEW |