haiku/headers/private/kernel/port.h
Ingo Weinhold 636bfc08ae * Renamed fs/vfs_select.cpp to wait_for_objects.cpp and got rid of
vfs_select.h, respectively moved most of it into the new kernel
  private header wait_for_objects.h.
* Added new experimental API functions wait_for_objects[_etc](). They
  work pretty much like poll(), but also for semaphores, ports, and
  threads.
* Removed the "ref" parameter from notify_select_events() and the
  select_sync_pool functions as well as from fd_ops::fd_[de]select(). It
  is no longer needed. The FS interface select() hook still has it,
  though -- the VFS will always pass 0.
* de]select_fd() take a select_info* instead of a select_sync* + ref
  pair, now. Added respective functions for semaphores, ports, and
  threads.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22416 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-02 19:47:31 +00:00

64 lines
1.8 KiB
C

/*
* Copyright 2005, Haiku Inc. All Rights Reserved.
* Distributed under the terms of the MIT license.
*/
#ifndef _KERNEL_PORT_H
#define _KERNEL_PORT_H
#include <thread.h>
#include <iovec.h>
struct kernel_args;
struct select_info;
#define PORT_FLAG_USE_USER_MEMCPY 0x80000000
#ifdef __cplusplus
extern "C" {
#endif
status_t port_init(struct kernel_args *args);
int delete_owned_ports(team_id owner);
int32 port_max_ports(void);
int32 port_used_ports(void);
status_t select_port(int32 object, struct select_info *info, bool kernel);
status_t deselect_port(int32 object, struct select_info *info, bool kernel);
// currently private API
status_t writev_port_etc(port_id id, int32 msgCode, const iovec *msgVecs,
size_t vecCount, size_t bufferSize, uint32 flags, bigtime_t timeout);
// temp: test
void port_test(void);
// user syscalls
port_id _user_create_port(int32 queueLength, const char *name);
status_t _user_close_port(port_id id);
status_t _user_delete_port(port_id id);
port_id _user_find_port(const char *portName);
status_t _user_get_port_info(port_id id, struct port_info *info);
status_t _user_get_next_port_info(team_id team, int32 *cookie,
struct port_info *info);
ssize_t _user_port_buffer_size_etc(port_id port, uint32 flags,
bigtime_t timeout);
ssize_t _user_port_count(port_id port);
ssize_t _user_read_port_etc(port_id port, int32 *msgCode,
void *msgBuffer, size_t bufferSize, uint32 flags,
bigtime_t timeout);
status_t _user_set_port_owner(port_id port, team_id team);
status_t _user_write_port_etc(port_id port, int32 msgCode,
const void *msgBuffer, size_t bufferSize,
uint32 flags, bigtime_t timeout);
status_t _user_writev_port_etc(port_id id, int32 msgCode,
const iovec *msgVecs, size_t vecCount,
size_t bufferSize, uint32 flags, bigtime_t timeout);
#ifdef __cplusplus
}
#endif
#endif /* _KERNEL_PORT_H */