1*5c2921b0SApple OSS Distributions /*
2*5c2921b0SApple OSS Distributions * Copyright (c) 2010-2014 Apple Inc. All rights reserved.
3*5c2921b0SApple OSS Distributions *
4*5c2921b0SApple OSS Distributions * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5*5c2921b0SApple OSS Distributions *
6*5c2921b0SApple OSS Distributions * This file contains Original Code and/or Modifications of Original Code
7*5c2921b0SApple OSS Distributions * as defined in and that are subject to the Apple Public Source License
8*5c2921b0SApple OSS Distributions * Version 2.0 (the 'License'). You may not use this file except in
9*5c2921b0SApple OSS Distributions * compliance with the License. The rights granted to you under the License
10*5c2921b0SApple OSS Distributions * may not be used to create, or enable the creation or redistribution of,
11*5c2921b0SApple OSS Distributions * unlawful or unlicensed copies of an Apple operating system, or to
12*5c2921b0SApple OSS Distributions * circumvent, violate, or enable the circumvention or violation of, any
13*5c2921b0SApple OSS Distributions * terms of an Apple operating system software license agreement.
14*5c2921b0SApple OSS Distributions *
15*5c2921b0SApple OSS Distributions * Please obtain a copy of the License at
16*5c2921b0SApple OSS Distributions * http://www.opensource.apple.com/apsl/ and read it before using this file.
17*5c2921b0SApple OSS Distributions *
18*5c2921b0SApple OSS Distributions * The Original Code and all software distributed under the License are
19*5c2921b0SApple OSS Distributions * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20*5c2921b0SApple OSS Distributions * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21*5c2921b0SApple OSS Distributions * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22*5c2921b0SApple OSS Distributions * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23*5c2921b0SApple OSS Distributions * Please see the License for the specific language governing rights and
24*5c2921b0SApple OSS Distributions * limitations under the License.
25*5c2921b0SApple OSS Distributions *
26*5c2921b0SApple OSS Distributions * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27*5c2921b0SApple OSS Distributions */
28*5c2921b0SApple OSS Distributions
29*5c2921b0SApple OSS Distributions #include "_libkernel_init.h"
30*5c2921b0SApple OSS Distributions #include "strings.h"
31*5c2921b0SApple OSS Distributions
32*5c2921b0SApple OSS Distributions extern _libkernel_functions_t _libkernel_functions;
33*5c2921b0SApple OSS Distributions extern void mig_os_release(void* ptr);
34*5c2921b0SApple OSS Distributions
35*5c2921b0SApple OSS Distributions __attribute__((visibility("hidden")))
36*5c2921b0SApple OSS Distributions void *
malloc(size_t size)37*5c2921b0SApple OSS Distributions malloc(size_t size)
38*5c2921b0SApple OSS Distributions {
39*5c2921b0SApple OSS Distributions if (_libkernel_functions->malloc) {
40*5c2921b0SApple OSS Distributions return _libkernel_functions->malloc(size);
41*5c2921b0SApple OSS Distributions }
42*5c2921b0SApple OSS Distributions return NULL;
43*5c2921b0SApple OSS Distributions }
44*5c2921b0SApple OSS Distributions
45*5c2921b0SApple OSS Distributions __attribute__((visibility("hidden")))
46*5c2921b0SApple OSS Distributions void
free(void * ptr)47*5c2921b0SApple OSS Distributions free(void *ptr)
48*5c2921b0SApple OSS Distributions {
49*5c2921b0SApple OSS Distributions if (_libkernel_functions->free) {
50*5c2921b0SApple OSS Distributions _libkernel_functions->free(ptr);
51*5c2921b0SApple OSS Distributions }
52*5c2921b0SApple OSS Distributions }
53*5c2921b0SApple OSS Distributions
54*5c2921b0SApple OSS Distributions __attribute__((visibility("hidden")))
55*5c2921b0SApple OSS Distributions void *
realloc(void * ptr,size_t size)56*5c2921b0SApple OSS Distributions realloc(void *ptr, size_t size)
57*5c2921b0SApple OSS Distributions {
58*5c2921b0SApple OSS Distributions if (_libkernel_functions->realloc) {
59*5c2921b0SApple OSS Distributions return _libkernel_functions->realloc(ptr, size);
60*5c2921b0SApple OSS Distributions }
61*5c2921b0SApple OSS Distributions return NULL;
62*5c2921b0SApple OSS Distributions }
63*5c2921b0SApple OSS Distributions
64*5c2921b0SApple OSS Distributions __attribute__((visibility("hidden")))
65*5c2921b0SApple OSS Distributions void *
reallocf(void * ptr,size_t size)66*5c2921b0SApple OSS Distributions reallocf(void *ptr, size_t size)
67*5c2921b0SApple OSS Distributions {
68*5c2921b0SApple OSS Distributions void *nptr = realloc(ptr, size);
69*5c2921b0SApple OSS Distributions if (!nptr && ptr) {
70*5c2921b0SApple OSS Distributions free(ptr);
71*5c2921b0SApple OSS Distributions }
72*5c2921b0SApple OSS Distributions return nptr;
73*5c2921b0SApple OSS Distributions }
74*5c2921b0SApple OSS Distributions
75*5c2921b0SApple OSS Distributions __attribute__((visibility("hidden")))
76*5c2921b0SApple OSS Distributions void
_pthread_exit_if_canceled(int error)77*5c2921b0SApple OSS Distributions _pthread_exit_if_canceled(int error)
78*5c2921b0SApple OSS Distributions {
79*5c2921b0SApple OSS Distributions return _libkernel_functions->_pthread_exit_if_canceled(error);
80*5c2921b0SApple OSS Distributions }
81*5c2921b0SApple OSS Distributions
82*5c2921b0SApple OSS Distributions __attribute__((visibility("hidden")))
83*5c2921b0SApple OSS Distributions void
_pthread_set_self(void * ptr)84*5c2921b0SApple OSS Distributions _pthread_set_self(void *ptr __attribute__((__unused__)))
85*5c2921b0SApple OSS Distributions {
86*5c2921b0SApple OSS Distributions }
87*5c2921b0SApple OSS Distributions
88*5c2921b0SApple OSS Distributions __attribute__((visibility("hidden")))
89*5c2921b0SApple OSS Distributions void
_pthread_clear_qos_tsd(mach_port_t thread_port)90*5c2921b0SApple OSS Distributions _pthread_clear_qos_tsd(mach_port_t thread_port)
91*5c2921b0SApple OSS Distributions {
92*5c2921b0SApple OSS Distributions if (_libkernel_functions->version >= 3 &&
93*5c2921b0SApple OSS Distributions _libkernel_functions->pthread_clear_qos_tsd) {
94*5c2921b0SApple OSS Distributions return _libkernel_functions->pthread_clear_qos_tsd(thread_port);
95*5c2921b0SApple OSS Distributions }
96*5c2921b0SApple OSS Distributions }
97*5c2921b0SApple OSS Distributions
98*5c2921b0SApple OSS Distributions __attribute__((visibility("hidden")))
99*5c2921b0SApple OSS Distributions int
pthread_current_stack_contains_np(const void * addr,size_t len)100*5c2921b0SApple OSS Distributions pthread_current_stack_contains_np(const void *addr, size_t len)
101*5c2921b0SApple OSS Distributions {
102*5c2921b0SApple OSS Distributions if (_libkernel_functions->version >= 4 &&
103*5c2921b0SApple OSS Distributions _libkernel_functions->pthread_current_stack_contains_np) {
104*5c2921b0SApple OSS Distributions return _libkernel_functions->pthread_current_stack_contains_np(addr, len);
105*5c2921b0SApple OSS Distributions }
106*5c2921b0SApple OSS Distributions
107*5c2921b0SApple OSS Distributions return 0;
108*5c2921b0SApple OSS Distributions }
109*5c2921b0SApple OSS Distributions
110*5c2921b0SApple OSS Distributions /*
111*5c2921b0SApple OSS Distributions * Upcalls to optimized libplatform string functions
112*5c2921b0SApple OSS Distributions */
113*5c2921b0SApple OSS Distributions
114*5c2921b0SApple OSS Distributions static const struct _libkernel_string_functions
115*5c2921b0SApple OSS Distributions _libkernel_generic_string_functions = {
116*5c2921b0SApple OSS Distributions .bzero = _libkernel_bzero,
117*5c2921b0SApple OSS Distributions .memmove = _libkernel_memmove,
118*5c2921b0SApple OSS Distributions .memset = _libkernel_memset,
119*5c2921b0SApple OSS Distributions .strchr = _libkernel_strchr,
120*5c2921b0SApple OSS Distributions .strcmp = _libkernel_strcmp,
121*5c2921b0SApple OSS Distributions .strcpy = _libkernel_strcpy,
122*5c2921b0SApple OSS Distributions .strlcpy = _libkernel_strlcpy,
123*5c2921b0SApple OSS Distributions .strlen = _libkernel_strlen,
124*5c2921b0SApple OSS Distributions };
125*5c2921b0SApple OSS Distributions static _libkernel_string_functions_t _libkernel_string_functions =
126*5c2921b0SApple OSS Distributions &_libkernel_generic_string_functions;
127*5c2921b0SApple OSS Distributions
128*5c2921b0SApple OSS Distributions kern_return_t
__libkernel_platform_init(_libkernel_string_functions_t fns)129*5c2921b0SApple OSS Distributions __libkernel_platform_init(_libkernel_string_functions_t fns)
130*5c2921b0SApple OSS Distributions {
131*5c2921b0SApple OSS Distributions _libkernel_string_functions = fns;
132*5c2921b0SApple OSS Distributions return KERN_SUCCESS;
133*5c2921b0SApple OSS Distributions }
134*5c2921b0SApple OSS Distributions
135*5c2921b0SApple OSS Distributions __attribute__((visibility("hidden")))
136*5c2921b0SApple OSS Distributions void
bzero(void * s,size_t n)137*5c2921b0SApple OSS Distributions bzero(void *s, size_t n)
138*5c2921b0SApple OSS Distributions {
139*5c2921b0SApple OSS Distributions return _libkernel_string_functions->bzero(s, n);
140*5c2921b0SApple OSS Distributions }
141*5c2921b0SApple OSS Distributions
142*5c2921b0SApple OSS Distributions __attribute__((visibility("hidden")))
143*5c2921b0SApple OSS Distributions void
__bzero(void * s,size_t n)144*5c2921b0SApple OSS Distributions __bzero(void *s, size_t n)
145*5c2921b0SApple OSS Distributions {
146*5c2921b0SApple OSS Distributions return _libkernel_string_functions->bzero(s, n);
147*5c2921b0SApple OSS Distributions }
148*5c2921b0SApple OSS Distributions
149*5c2921b0SApple OSS Distributions __attribute__((visibility("hidden")))
150*5c2921b0SApple OSS Distributions void *
memchr(const void * s,int c,size_t n)151*5c2921b0SApple OSS Distributions memchr(const void *s, int c, size_t n)
152*5c2921b0SApple OSS Distributions {
153*5c2921b0SApple OSS Distributions return _libkernel_string_functions->memchr(s, c, n);
154*5c2921b0SApple OSS Distributions }
155*5c2921b0SApple OSS Distributions
156*5c2921b0SApple OSS Distributions __attribute__((visibility("hidden")))
157*5c2921b0SApple OSS Distributions int
memcmp(const void * s1,const void * s2,size_t n)158*5c2921b0SApple OSS Distributions memcmp(const void *s1, const void *s2, size_t n)
159*5c2921b0SApple OSS Distributions {
160*5c2921b0SApple OSS Distributions return _libkernel_string_functions->memcmp(s1, s2, n);
161*5c2921b0SApple OSS Distributions }
162*5c2921b0SApple OSS Distributions
163*5c2921b0SApple OSS Distributions __attribute__((visibility("hidden")))
164*5c2921b0SApple OSS Distributions void *
memmove(void * dst,const void * src,size_t n)165*5c2921b0SApple OSS Distributions memmove(void *dst, const void *src, size_t n)
166*5c2921b0SApple OSS Distributions {
167*5c2921b0SApple OSS Distributions return _libkernel_string_functions->memmove(dst, src, n);
168*5c2921b0SApple OSS Distributions }
169*5c2921b0SApple OSS Distributions
170*5c2921b0SApple OSS Distributions __attribute__((visibility("hidden")))
171*5c2921b0SApple OSS Distributions void *
memcpy(void * dst,const void * src,size_t n)172*5c2921b0SApple OSS Distributions memcpy(void *dst, const void *src, size_t n)
173*5c2921b0SApple OSS Distributions {
174*5c2921b0SApple OSS Distributions return _libkernel_string_functions->memmove(dst, src, n);
175*5c2921b0SApple OSS Distributions }
176*5c2921b0SApple OSS Distributions
177*5c2921b0SApple OSS Distributions __attribute__((visibility("hidden")))
178*5c2921b0SApple OSS Distributions void *
memccpy(void * __restrict dst,const void * __restrict src,int c,size_t n)179*5c2921b0SApple OSS Distributions memccpy(void *__restrict dst, const void *__restrict src, int c, size_t n)
180*5c2921b0SApple OSS Distributions {
181*5c2921b0SApple OSS Distributions return _libkernel_string_functions->memccpy(dst, src, c, n);
182*5c2921b0SApple OSS Distributions }
183*5c2921b0SApple OSS Distributions
184*5c2921b0SApple OSS Distributions __attribute__((visibility("hidden")))
185*5c2921b0SApple OSS Distributions void *
memset(void * b,int c,size_t len)186*5c2921b0SApple OSS Distributions memset(void *b, int c, size_t len)
187*5c2921b0SApple OSS Distributions {
188*5c2921b0SApple OSS Distributions return _libkernel_string_functions->memset(b, c, len);
189*5c2921b0SApple OSS Distributions }
190*5c2921b0SApple OSS Distributions
191*5c2921b0SApple OSS Distributions __attribute__((visibility("hidden")))
192*5c2921b0SApple OSS Distributions char *
strchr(const char * s,int c)193*5c2921b0SApple OSS Distributions strchr(const char *s, int c)
194*5c2921b0SApple OSS Distributions {
195*5c2921b0SApple OSS Distributions return _libkernel_string_functions->strchr(s, c);
196*5c2921b0SApple OSS Distributions }
197*5c2921b0SApple OSS Distributions
198*5c2921b0SApple OSS Distributions __attribute__((visibility("hidden")))
199*5c2921b0SApple OSS Distributions char *
index(const char * s,int c)200*5c2921b0SApple OSS Distributions index(const char *s, int c)
201*5c2921b0SApple OSS Distributions {
202*5c2921b0SApple OSS Distributions return _libkernel_string_functions->strchr(s, c);
203*5c2921b0SApple OSS Distributions }
204*5c2921b0SApple OSS Distributions
205*5c2921b0SApple OSS Distributions __attribute__((visibility("hidden")))
206*5c2921b0SApple OSS Distributions int
strcmp(const char * s1,const char * s2)207*5c2921b0SApple OSS Distributions strcmp(const char *s1, const char *s2)
208*5c2921b0SApple OSS Distributions {
209*5c2921b0SApple OSS Distributions return _libkernel_string_functions->strcmp(s1, s2);
210*5c2921b0SApple OSS Distributions }
211*5c2921b0SApple OSS Distributions
212*5c2921b0SApple OSS Distributions __attribute__((visibility("hidden")))
213*5c2921b0SApple OSS Distributions char *
strcpy(char * restrict dst,const char * restrict src)214*5c2921b0SApple OSS Distributions strcpy(char * restrict dst, const char * restrict src)
215*5c2921b0SApple OSS Distributions {
216*5c2921b0SApple OSS Distributions return _libkernel_string_functions->strcpy(dst, src);
217*5c2921b0SApple OSS Distributions }
218*5c2921b0SApple OSS Distributions
219*5c2921b0SApple OSS Distributions __attribute__((visibility("hidden")))
220*5c2921b0SApple OSS Distributions size_t
strlcat(char * restrict dst,const char * restrict src,size_t maxlen)221*5c2921b0SApple OSS Distributions strlcat(char * restrict dst, const char * restrict src, size_t maxlen)
222*5c2921b0SApple OSS Distributions {
223*5c2921b0SApple OSS Distributions return _libkernel_string_functions->strlcat(dst, src, maxlen);
224*5c2921b0SApple OSS Distributions }
225*5c2921b0SApple OSS Distributions
226*5c2921b0SApple OSS Distributions __attribute__((visibility("hidden")))
227*5c2921b0SApple OSS Distributions size_t
strlcpy(char * restrict dst,const char * restrict src,size_t maxlen)228*5c2921b0SApple OSS Distributions strlcpy(char * restrict dst, const char * restrict src, size_t maxlen)
229*5c2921b0SApple OSS Distributions {
230*5c2921b0SApple OSS Distributions return _libkernel_string_functions->strlcpy(dst, src, maxlen);
231*5c2921b0SApple OSS Distributions }
232*5c2921b0SApple OSS Distributions
233*5c2921b0SApple OSS Distributions __attribute__((visibility("hidden")))
234*5c2921b0SApple OSS Distributions size_t
strlen(const char * str)235*5c2921b0SApple OSS Distributions strlen(const char *str)
236*5c2921b0SApple OSS Distributions {
237*5c2921b0SApple OSS Distributions return _libkernel_string_functions->strlen(str);
238*5c2921b0SApple OSS Distributions }
239*5c2921b0SApple OSS Distributions
240*5c2921b0SApple OSS Distributions __attribute__((visibility("hidden")))
241*5c2921b0SApple OSS Distributions int
strncmp(const char * s1,const char * s2,size_t n)242*5c2921b0SApple OSS Distributions strncmp(const char *s1, const char *s2, size_t n)
243*5c2921b0SApple OSS Distributions {
244*5c2921b0SApple OSS Distributions return _libkernel_string_functions->strncmp(s1, s2, n);
245*5c2921b0SApple OSS Distributions }
246*5c2921b0SApple OSS Distributions
247*5c2921b0SApple OSS Distributions __attribute__((visibility("hidden")))
248*5c2921b0SApple OSS Distributions char *
strncpy(char * restrict dst,const char * restrict src,size_t maxlen)249*5c2921b0SApple OSS Distributions strncpy(char * restrict dst, const char * restrict src, size_t maxlen)
250*5c2921b0SApple OSS Distributions {
251*5c2921b0SApple OSS Distributions return _libkernel_string_functions->strncpy(dst, src, maxlen);
252*5c2921b0SApple OSS Distributions }
253*5c2921b0SApple OSS Distributions
254*5c2921b0SApple OSS Distributions __attribute__((visibility("hidden")))
255*5c2921b0SApple OSS Distributions size_t
strnlen(const char * s,size_t maxlen)256*5c2921b0SApple OSS Distributions strnlen(const char *s, size_t maxlen)
257*5c2921b0SApple OSS Distributions {
258*5c2921b0SApple OSS Distributions return _libkernel_string_functions->strnlen(s, maxlen);
259*5c2921b0SApple OSS Distributions }
260*5c2921b0SApple OSS Distributions
261*5c2921b0SApple OSS Distributions __attribute__((visibility("hidden")))
262*5c2921b0SApple OSS Distributions char *
strstr(const char * s,const char * find)263*5c2921b0SApple OSS Distributions strstr(const char *s, const char *find)
264*5c2921b0SApple OSS Distributions {
265*5c2921b0SApple OSS Distributions return _libkernel_string_functions->strstr(s, find);
266*5c2921b0SApple OSS Distributions }
267*5c2921b0SApple OSS Distributions
268*5c2921b0SApple OSS Distributions /*
269*5c2921b0SApple OSS Distributions * mach/mach.h voucher_mach_msg API
270*5c2921b0SApple OSS Distributions */
271*5c2921b0SApple OSS Distributions
272*5c2921b0SApple OSS Distributions static const struct _libkernel_voucher_functions
273*5c2921b0SApple OSS Distributions _libkernel_voucher_functions_empty;
274*5c2921b0SApple OSS Distributions static _libkernel_voucher_functions_t _libkernel_voucher_functions =
275*5c2921b0SApple OSS Distributions &_libkernel_voucher_functions_empty;
276*5c2921b0SApple OSS Distributions
277*5c2921b0SApple OSS Distributions kern_return_t
__libkernel_voucher_init(_libkernel_voucher_functions_t fns)278*5c2921b0SApple OSS Distributions __libkernel_voucher_init(_libkernel_voucher_functions_t fns)
279*5c2921b0SApple OSS Distributions {
280*5c2921b0SApple OSS Distributions _libkernel_voucher_functions = fns;
281*5c2921b0SApple OSS Distributions return KERN_SUCCESS;
282*5c2921b0SApple OSS Distributions }
283*5c2921b0SApple OSS Distributions
284*5c2921b0SApple OSS Distributions boolean_t
voucher_mach_msg_set(mach_msg_header_t * msg)285*5c2921b0SApple OSS Distributions voucher_mach_msg_set(mach_msg_header_t *msg)
286*5c2921b0SApple OSS Distributions {
287*5c2921b0SApple OSS Distributions if (_libkernel_voucher_functions->voucher_mach_msg_set) {
288*5c2921b0SApple OSS Distributions return _libkernel_voucher_functions->voucher_mach_msg_set(msg);
289*5c2921b0SApple OSS Distributions }
290*5c2921b0SApple OSS Distributions return FALSE;
291*5c2921b0SApple OSS Distributions }
292*5c2921b0SApple OSS Distributions
293*5c2921b0SApple OSS Distributions void
voucher_mach_msg_clear(mach_msg_header_t * msg)294*5c2921b0SApple OSS Distributions voucher_mach_msg_clear(mach_msg_header_t *msg)
295*5c2921b0SApple OSS Distributions {
296*5c2921b0SApple OSS Distributions if (_libkernel_voucher_functions->voucher_mach_msg_clear) {
297*5c2921b0SApple OSS Distributions _libkernel_voucher_functions->voucher_mach_msg_clear(msg);
298*5c2921b0SApple OSS Distributions }
299*5c2921b0SApple OSS Distributions }
300*5c2921b0SApple OSS Distributions
301*5c2921b0SApple OSS Distributions voucher_mach_msg_state_t
voucher_mach_msg_adopt(mach_msg_header_t * msg)302*5c2921b0SApple OSS Distributions voucher_mach_msg_adopt(mach_msg_header_t *msg)
303*5c2921b0SApple OSS Distributions {
304*5c2921b0SApple OSS Distributions if (_libkernel_voucher_functions->voucher_mach_msg_adopt) {
305*5c2921b0SApple OSS Distributions return _libkernel_voucher_functions->voucher_mach_msg_adopt(msg);
306*5c2921b0SApple OSS Distributions }
307*5c2921b0SApple OSS Distributions return VOUCHER_MACH_MSG_STATE_UNCHANGED;
308*5c2921b0SApple OSS Distributions }
309*5c2921b0SApple OSS Distributions
310*5c2921b0SApple OSS Distributions void
voucher_mach_msg_revert(voucher_mach_msg_state_t state)311*5c2921b0SApple OSS Distributions voucher_mach_msg_revert(voucher_mach_msg_state_t state)
312*5c2921b0SApple OSS Distributions {
313*5c2921b0SApple OSS Distributions if (_libkernel_voucher_functions->voucher_mach_msg_revert) {
314*5c2921b0SApple OSS Distributions _libkernel_voucher_functions->voucher_mach_msg_revert(state);
315*5c2921b0SApple OSS Distributions }
316*5c2921b0SApple OSS Distributions }
317*5c2921b0SApple OSS Distributions
318*5c2921b0SApple OSS Distributions mach_msg_size_t
voucher_mach_msg_fill_aux(mach_msg_aux_header_t * aux_hdr,mach_msg_size_t sz)319*5c2921b0SApple OSS Distributions voucher_mach_msg_fill_aux(mach_msg_aux_header_t *aux_hdr, mach_msg_size_t sz)
320*5c2921b0SApple OSS Distributions {
321*5c2921b0SApple OSS Distributions if (_libkernel_voucher_functions->version < 3) {
322*5c2921b0SApple OSS Distributions return 0;
323*5c2921b0SApple OSS Distributions }
324*5c2921b0SApple OSS Distributions if (_libkernel_voucher_functions->voucher_mach_msg_fill_aux) {
325*5c2921b0SApple OSS Distributions return _libkernel_voucher_functions->voucher_mach_msg_fill_aux(aux_hdr, sz);
326*5c2921b0SApple OSS Distributions }
327*5c2921b0SApple OSS Distributions return 0;
328*5c2921b0SApple OSS Distributions }
329*5c2921b0SApple OSS Distributions
330*5c2921b0SApple OSS Distributions boolean_t
voucher_mach_msg_fill_aux_supported(void)331*5c2921b0SApple OSS Distributions voucher_mach_msg_fill_aux_supported(void)
332*5c2921b0SApple OSS Distributions {
333*5c2921b0SApple OSS Distributions if (_libkernel_voucher_functions->version < 3) {
334*5c2921b0SApple OSS Distributions return FALSE;
335*5c2921b0SApple OSS Distributions }
336*5c2921b0SApple OSS Distributions return NULL != _libkernel_voucher_functions->voucher_mach_msg_fill_aux;
337*5c2921b0SApple OSS Distributions }
338