1/*
2 * Copyright 2002, Axel D��rfler, axeld@pinc-software.de. All rights reserved.
3 * Distributed under the terms of the MIT License.
4 */
5
6
7#include <OS.h>
8#include "syscalls.h"
9
10
11port_id
12create_port(int32 capacity, const char *name)
13{
14	return _kern_create_port(capacity, name);
15}
16
17
18port_id
19find_port(const char *name)
20{
21	return _kern_find_port(name);
22}
23
24
25status_t
26write_port(port_id port, int32 code, const void *buffer, size_t bufferSize)
27{
28	return _kern_write_port_etc(port, code, buffer, bufferSize, 0, 0);
29}
30
31
32ssize_t
33read_port(port_id port, int32 *code, void *buffer, size_t bufferSize)
34{
35	return _kern_read_port_etc(port, code, buffer, bufferSize, 0, 0);
36}
37
38
39status_t
40write_port_etc(port_id port, int32 code, const void *buffer, size_t bufferSize,
41	uint32 flags, bigtime_t timeout)
42{
43	return _kern_write_port_etc(port, code, buffer, bufferSize, flags, timeout);
44}
45
46
47ssize_t
48read_port_etc(port_id port, int32 *code, void *buffer, size_t bufferSize,
49	uint32 flags, bigtime_t timeout)
50{
51	return _kern_read_port_etc(port, code, buffer, bufferSize, flags, timeout);
52}
53
54
55ssize_t
56port_buffer_size(port_id port)
57{
58	return _kern_port_buffer_size_etc(port, 0, 0);
59}
60
61
62ssize_t
63port_buffer_size_etc(port_id port, uint32 flags, bigtime_t timeout)
64{
65	return _kern_port_buffer_size_etc(port, flags, timeout);
66}
67
68
69ssize_t
70port_count(port_id port)
71{
72	return _kern_port_count(port);
73}
74
75
76status_t
77set_port_owner(port_id port, team_id team)
78{
79	return _kern_set_port_owner(port, team);
80}
81
82
83status_t
84close_port(port_id port)
85{
86	return _kern_close_port(port);
87}
88
89
90status_t
91delete_port(port_id port)
92{
93	return _kern_delete_port(port);
94}
95
96
97status_t
98_get_next_port_info(team_id team, int32 *cookie, port_info *info, size_t size)
99{
100	// size is not yet used, but may, if port_info changes
101	(void)size;
102
103	return _kern_get_next_port_info(team, cookie, info);
104}
105
106
107status_t
108_get_port_info(port_id port, port_info *info, size_t size)
109{
110	return _kern_get_port_info(port, info);
111}
112
113
114status_t
115_get_port_message_info_etc(port_id port, port_message_info *info,
116	size_t infoSize, uint32 flags, bigtime_t timeout)
117{
118	return _kern_get_port_message_info_etc(port, info, infoSize, flags,
119		timeout);
120}
121