OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef BASE_MACH_IPC_MAC_H_ | 5 #ifndef BASE_MACH_IPC_MAC_H_ |
6 #define BASE_MACH_IPC_MAC_H_ | 6 #define BASE_MACH_IPC_MAC_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <mach/mach.h> | 9 #include <mach/mach.h> |
10 #include <mach/message.h> | 10 #include <mach/message.h> |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 kern_return_t SendMessage(MachSendMessage &message, | 302 kern_return_t SendMessage(MachSendMessage &message, |
303 mach_msg_timeout_t timeout); | 303 mach_msg_timeout_t timeout); |
304 | 304 |
305 private: | 305 private: |
306 mach_port_t send_port_; | 306 mach_port_t send_port_; |
307 kern_return_t init_result_; | 307 kern_return_t init_result_; |
308 | 308 |
309 DISALLOW_COPY_AND_ASSIGN(MachPortSender); | 309 DISALLOW_COPY_AND_ASSIGN(MachPortSender); |
310 }; | 310 }; |
311 | 311 |
| 312 //============================================================================== |
| 313 // Static utility functions. |
| 314 |
| 315 namespace mac { |
| 316 |
| 317 // Returns the number of Mach ports to which the given task has a right. |
| 318 // Note that unless the calling task has send rights to the passed task port, |
| 319 // this will fail unless the calling task is running as root. |
| 320 kern_return_t BASE_EXPORT GetNumberOfMachPorts(mach_port_t task_port, |
| 321 int* port_count); |
| 322 |
| 323 } // namespace mac |
| 324 |
312 } // namespace base | 325 } // namespace base |
313 | 326 |
314 #endif // BASE_MACH_IPC_MAC_H_ | 327 #endif // BASE_MACH_IPC_MAC_H_ |
OLD | NEW |