xref: /haiku/headers/private/kernel/port.h (revision 52a380120846174213ccce9c4aab0dda17c72083)
1 /* ports.h
2  *
3  * Definitions here are for kernel use only. For the actual
4  * definitions of port functions, please look at OS.h
5  */
6 
7 #ifndef _KERNEL_PORT_H
8 #define _KERNEL_PORT_H
9 
10 #include <thread.h>
11 
12 #define PORT_FLAG_USE_USER_MEMCPY 0x80000000
13 
14 int port_init(kernel_args *ka);
15 int delete_owned_ports(proc_id owner);
16 
17 // temp: test
18 void port_test(void);
19 int	 port_test_thread_func(void* arg);
20 
21 // user-level API
22 port_id		user_create_port(int32 queue_length, const char *name);
23 int			user_close_port(port_id id);
24 int			user_delete_port(port_id id);
25 port_id		user_find_port(const char *port_name);
26 int			user_get_port_info(port_id id, struct port_info *info);
27 int		 	user_get_next_port_info(proc_id proc,
28 				uint32 *cookie,
29 				struct port_info *info);
30 ssize_t		user_port_buffer_size_etc(port_id port,
31 				uint32 flags,
32 				bigtime_t timeout);
33 int32		user_port_count(port_id port);
34 ssize_t		user_read_port_etc(port_id port,
35 				int32 *msg_code,
36 				void *msg_buffer,
37 				size_t buffer_size,
38 				uint32 flags,
39 				bigtime_t timeout);
40 int			user_set_port_owner(port_id port, proc_id proc);
41 int			user_write_port_etc(port_id port,
42 				int32 msg_code,
43 				void *msg_buffer,
44 				size_t buffer_size,
45 				uint32 flags,
46 				bigtime_t timeout);
47 
48 #endif
49