]>
git.saurik.com Git - apple/libc.git/blob - mach/port_obj.c
5c313d2314c4b8c4adc0f7cf1c8429abca860fba
2 * Copyright (c) 2003 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
23 * @APPLE_LICENSE_HEADER_END@
30 * Define a service to map from a kernel-generated port name
31 * to server-defined "type" and "value" data to be associated
34 #include <mach/port_obj.h>
35 #include <mach/mach.h>
37 #define DEFAULT_TABLE_SIZE (64 * 1024)
39 struct port_obj_tentry
*port_obj_table
;
40 int port_obj_table_size
= DEFAULT_TABLE_SIZE
;
47 kr
= vm_allocate(mach_task_self(),
48 (vm_offset_t
*)&port_obj_table
,
49 (vm_size_t
)(maxsize
* sizeof (*port_obj_table
)),
51 if (kr
!= KERN_SUCCESS
)
52 panic("port_obj_init: can't vm_allocate");