vfs: check userland buffers before reading them.
[haiku.git] / src / system / libroot / os / sem.c
blobb07143d05f9ad8db96b5f2742268ab29f5a1645e
1 /*
2 * Copyright 2002-2005, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
3 * Distributed under the terms of the MIT License.
4 */
7 #include <OS.h>
8 #include <syscalls.h>
11 sem_id
12 create_sem(int32 count, const char *name)
14 return _kern_create_sem(count, name);
18 status_t
19 delete_sem(sem_id id)
21 return _kern_delete_sem(id);
25 status_t
26 acquire_sem(sem_id id)
28 return _kern_acquire_sem(id);
32 status_t
33 acquire_sem_etc(sem_id id, int32 count, uint32 flags, bigtime_t timeout)
35 return _kern_acquire_sem_etc(id, count, flags, timeout);
39 // ToDo: the next two calls (switch_sem()) are not yet public API; no decision
40 // has been made yet, so they may get changed or removed until R1
42 status_t
43 switch_sem(sem_id releaseSem, sem_id id)
45 return _kern_switch_sem(releaseSem, id);
49 status_t
50 switch_sem_etc(sem_id releaseSem, sem_id id, int32 count, uint32 flags, bigtime_t timeout)
52 return _kern_switch_sem_etc(releaseSem, id, count, flags, timeout);
56 status_t
57 release_sem(sem_id id)
59 return _kern_release_sem(id);
63 status_t
64 release_sem_etc(sem_id id, int32 count, uint32 flags)
66 return _kern_release_sem_etc(id, count, flags);
70 status_t
71 get_sem_count(sem_id sem, int32 *count)
73 return _kern_get_sem_count(sem, count);
77 status_t
78 set_sem_owner(sem_id sem, team_id team)
80 return _kern_set_sem_owner(sem, team);
84 status_t
85 _get_sem_info(sem_id sem, sem_info *info, size_t size)
87 return _kern_get_sem_info(sem, info, size);
91 status_t
92 _get_next_sem_info(team_id team, int32 *cookie, sem_info *info, size_t size)
94 return _kern_get_next_sem_info(team, cookie, info, size);