2 * Copyright (c) 2008-2009 Apple Inc. All rights reserved.
4 * @APPLE_APACHE_LICENSE_HEADER_START@
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
10 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 * @APPLE_APACHE_LICENSE_HEADER_END@
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.
27 #ifndef __DISPATCH_SOURCE_PRIVATE__
28 #define __DISPATCH_SOURCE_PRIVATE__
30 #ifndef __DISPATCH_INDIRECT__
31 #error "Please #include <dispatch/dispatch.h> instead of this file directly."
32 #include <dispatch/base.h> // for HeaderDoc
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).
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
;
46 * @enum dispatch_source_vfs_flags_t
48 * @constant DISPATCH_VFS_NOTRESP
51 * @constant DISPATCH_VFS_NEEDAUTH
54 * @constant DISPATCH_VFS_LOWDISK
57 * @constant DISPATCH_VFS_MOUNT
58 * New filesystem arrived.
60 * @constant DISPATCH_VFS_UNMOUNT
61 * Filesystem has left.
63 * @constant DISPATCH_VFS_DEAD
64 * Filesystem is dead, needs force unmount.
66 * @constant DISPATCH_VFS_ASSIST
67 * Filesystem needs assistance from external program.
69 * @constant DISPATCH_VFS_NOTRESPLOCK
72 * @constant DISPATCH_VFS_UPDATE
73 * Filesystem information has changed.
75 * @constant DISPATCH_VFS_VERYLOWDISK
76 * File system has *very* little disk space left.
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,
92 * @enum dispatch_source_mach_send_flags_t
94 * @constant DISPATCH_MACH_SEND_DELETED
95 * The receive right corresponding to the given send right was destroyed.
98 DISPATCH_MACH_SEND_DELETED
= 0x2,
102 * @enum dispatch_source_proc_flags_t
104 * @constant DISPATCH_PROC_REAP
105 * The process has been reaped by the parent process via
109 DISPATCH_PROC_REAP
= 0x10000000,
115 * @typedef dispatch_mig_callback_t
118 * The signature of a function that handles Mach message delivery and response.
120 typedef boolean_t (*dispatch_mig_callback_t
)(mach_msg_header_t
*message
, mach_msg_header_t
*reply
);
122 __OSX_AVAILABLE_STARTING(__MAC_10_6
,__IPHONE_NA
)
123 DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
125 dispatch_mig_server(dispatch_source_t ds
, size_t maxmsgsz
, dispatch_mig_callback_t callback
);