OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 // This file is used to handle differences in Mach message IDs and structures | |
6 // that occur between different OS versions. The Mach messages that the sandbox | |
7 // is interested in are decoded using information derived from the open-source | |
8 // libraries, i.e. <http://www.opensource.apple.com/source/launchd/>. While | |
9 // these messages definitions are open source, they are not considered part of | |
10 // the stable OS API, and so differences do exist between OS versions. | |
11 | |
12 #ifndef SANDBOX_MAC_OS_COMPATIBILITY_H_ | |
13 #define SANDBOX_MAC_OS_COMPATIBILITY_H_ | |
14 | |
15 #include <mach/mach.h> | |
16 | |
17 namespace sandbox { | |
18 | |
19 typedef const char* (*LookUp2GetRequestName)(const mach_msg_header_t*); | |
20 typedef void (*LookUp2FillReply)(mach_msg_header_t*, mach_port_t service_port); | |
21 | |
22 struct LaunchdCompatibilityShim { | |
23 // The msgh_id for look_up2. | |
24 mach_msg_id_t msg_id_look_up2; | |
25 // The msgh_id for swap_integer. | |
Mark Mentovai
2014/05/06 20:51:50
Can you put some vertical whitespace in here so it
Robert Sesek
2014/05/08 20:58:12
Done.
| |
26 mach_msg_id_t msg_id_swap_integer; | |
27 // A function to take a look_up2 message and return the string service name | |
28 // that was requested via the message. | |
29 LookUp2GetRequestName look_up2_get_request_name; | |
30 // A function to formulate a reply to a look_up2 message, given the reply | |
31 // message and the port to return as the service. | |
32 LookUp2FillReply look_up2_fill_reply; | |
33 }; | |
34 | |
35 // Gets the compatibility shim for the launchd job subsystem. | |
36 const LaunchdCompatibilityShim GetLaunchdCompatibilityShim(); | |
37 | |
38 } // namespace sandbox | |
39 | |
40 #endif // SANDBOX_MAC_OS_COMPATIBILITY_H_ | |
OLD | NEW |