]> git.saurik.com Git - apple/libc.git/blob - mach/semaphore.c
Libc-262.tar.gz
[apple/libc.git] / mach / semaphore.c
1 /*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
11 *
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
18 * under the License.
19 *
20 * @APPLE_LICENSE_HEADER_END@
21 */
22
23 #include <mach/boolean.h>
24 #include <mach/message.h>
25 #include <mach/kern_return.h>
26 #include <mach/mach_traps.h>
27 #include <mach/mach_types.h>
28 #include <mach/clock_types.h>
29
30 kern_return_t semaphore_signal(
31 mach_port_t signal_semaphore)
32 {
33 return semaphore_signal_trap(signal_semaphore);
34 }
35
36 kern_return_t semaphore_signal_all(
37 mach_port_t signal_semaphore)
38 {
39 return semaphore_signal_all_trap(signal_semaphore);
40 }
41
42 kern_return_t semaphore_signal_thread(
43 mach_port_t signal_semaphore,
44 mach_port_t thread_act)
45 {
46 return semaphore_signal_thread_trap(signal_semaphore, thread_act);
47 }
48
49 kern_return_t semaphore_wait (
50 mach_port_t wait_semaphore)
51 {
52 return semaphore_wait_trap(wait_semaphore);
53 }
54
55 kern_return_t semaphore_timedwait (
56 mach_port_t wait_semaphore,
57 mach_timespec_t wait_time)
58 {
59 return semaphore_timedwait_trap(wait_semaphore,
60 wait_time.tv_sec,
61 wait_time.tv_nsec);
62 }
63
64 kern_return_t semaphore_wait_signal (
65 mach_port_t wait_semaphore,
66 mach_port_t signal_semaphore)
67 {
68 return semaphore_wait_signal_trap(wait_semaphore, signal_semaphore);
69 }
70
71 kern_return_t semaphore_timedwait_signal (
72 mach_port_t wait_semaphore,
73 mach_port_t signal_semaphore,
74 mach_timespec_t wait_time)
75 {
76 return semaphore_timedwait_signal_trap(wait_semaphore,
77 signal_semaphore,
78 wait_time.tv_sec,
79 wait_time.tv_nsec);
80 }