]> git.saurik.com Git - apple/libdispatch.git/blob - src/source_private.h
libdispatch-84.5.tar.gz
[apple/libdispatch.git] / src / source_private.h
1 /*
2 * Copyright (c) 2008-2009 Apple Inc. All rights reserved.
3 *
4 * @APPLE_APACHE_LICENSE_HEADER_START@
5 *
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 *
18 * @APPLE_APACHE_LICENSE_HEADER_END@
19 */
20
21 /*
22 * IMPORTANT: This header file describes INTERNAL interfaces to libdispatch
23 * which are subject to change in future releases of Mac OS X. Any applications
24 * relying on these interfaces WILL break.
25 */
26
27 #ifndef __DISPATCH_SOURCE_PRIVATE__
28 #define __DISPATCH_SOURCE_PRIVATE__
29
30 #ifndef __DISPATCH_INDIRECT__
31 #error "Please #include <dispatch/dispatch.h> instead of this file directly."
32 #include <dispatch/base.h> // for HeaderDoc
33 #endif
34
35 /*!
36 * @const DISPATCH_SOURCE_TYPE_VFS
37 * @discussion Apple-internal dispatch source that monitors for vfs events
38 * defined by dispatch_vfs_flags_t.
39 * The handle is a process identifier (pid_t).
40 */
41 #define DISPATCH_SOURCE_TYPE_VFS (&_dispatch_source_type_vfs)
42 __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_NA)
43 extern const struct dispatch_source_type_s _dispatch_source_type_vfs;
44
45 /*!
46 * @enum dispatch_source_vfs_flags_t
47 *
48 * @constant DISPATCH_VFS_NOTRESP
49 * Server down.
50 *
51 * @constant DISPATCH_VFS_NEEDAUTH
52 * Server bad auth.
53 *
54 * @constant DISPATCH_VFS_LOWDISK
55 * We're low on space.
56 *
57 * @constant DISPATCH_VFS_MOUNT
58 * New filesystem arrived.
59 *
60 * @constant DISPATCH_VFS_UNMOUNT
61 * Filesystem has left.
62 *
63 * @constant DISPATCH_VFS_DEAD
64 * Filesystem is dead, needs force unmount.
65 *
66 * @constant DISPATCH_VFS_ASSIST
67 * Filesystem needs assistance from external program.
68 *
69 * @constant DISPATCH_VFS_NOTRESPLOCK
70 * Server lockd down.
71 *
72 * @constant DISPATCH_VFS_UPDATE
73 * Filesystem information has changed.
74 *
75 * @constant DISPATCH_VFS_VERYLOWDISK
76 * File system has *very* little disk space left.
77 */
78 enum {
79 DISPATCH_VFS_NOTRESP = 0x0001,
80 DISPATCH_VFS_NEEDAUTH = 0x0002,
81 DISPATCH_VFS_LOWDISK = 0x0004,
82 DISPATCH_VFS_MOUNT = 0x0008,
83 DISPATCH_VFS_UNMOUNT = 0x0010,
84 DISPATCH_VFS_DEAD = 0x0020,
85 DISPATCH_VFS_ASSIST = 0x0040,
86 DISPATCH_VFS_NOTRESPLOCK = 0x0080,
87 DISPATCH_VFS_UPDATE = 0x0100,
88 DISPATCH_VFS_VERYLOWDISK = 0x0200,
89 };
90
91 /*!
92 * @enum dispatch_source_mach_send_flags_t
93 *
94 * @constant DISPATCH_MACH_SEND_DELETED
95 * The receive right corresponding to the given send right was destroyed.
96 */
97 enum {
98 DISPATCH_MACH_SEND_DELETED = 0x2,
99 };
100
101 /*!
102 * @enum dispatch_source_proc_flags_t
103 *
104 * @constant DISPATCH_PROC_REAP
105 * The process has been reaped by the parent process via
106 * wait*().
107 */
108 enum {
109 DISPATCH_PROC_REAP = 0x10000000,
110 };
111
112 __BEGIN_DECLS
113
114 /*!
115 * @typedef dispatch_mig_callback_t
116 *
117 * @abstract
118 * The signature of a function that handles Mach message delivery and response.
119 */
120 typedef boolean_t (*dispatch_mig_callback_t)(mach_msg_header_t *message, mach_msg_header_t *reply);
121
122 __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_NA)
123 DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
124 mach_msg_return_t
125 dispatch_mig_server(dispatch_source_t ds, size_t maxmsgsz, dispatch_mig_callback_t callback);
126
127 __END_DECLS
128
129 #endif