]> git.saurik.com Git - apple/libc.git/blame - mach.subproj/port_obj.c
Libc-186.tar.gz
[apple/libc.git] / mach.subproj / port_obj.c
CommitLineData
e9ce8d39
A
1/*
2 * @OSF_COPYRIGHT@
3 */
4
5/*
6 * Define a service to map from a kernel-generated port name
7 * to server-defined "type" and "value" data to be associated
8 * with the port.
9 */
10#include <mach/port_obj.h>
11#include <mach/mach.h>
12
13#define DEFAULT_TABLE_SIZE (64 * 1024)
14
15struct port_obj_tentry *port_obj_table;
16int port_obj_table_size = DEFAULT_TABLE_SIZE;
17
18void port_obj_init(
19 int maxsize)
20{
21 kern_return_t kr;
22
23 kr = vm_allocate(mach_task_self(),
24 (vm_offset_t *)&port_obj_table,
25 (vm_size_t)(maxsize * sizeof (*port_obj_table)),
26 TRUE);
27 if (kr != KERN_SUCCESS)
28 panic("port_obj_init: can't vm_allocate");
29}