]>
Commit | Line | Data |
---|---|---|
04277e02 | 1 | /* Copyright (C) 1993-2019 Free Software Foundation, Inc. |
c84142e8 | 2 | This file is part of the GNU C Library. |
28f540f4 | 3 | |
c84142e8 | 4 | The GNU C Library is free software; you can redistribute it and/or |
41bdb6e2 AJ |
5 | modify it under the terms of the GNU Lesser General Public |
6 | License as published by the Free Software Foundation; either | |
7 | version 2.1 of the License, or (at your option) any later version. | |
28f540f4 | 8 | |
c84142e8 UD |
9 | The GNU C Library is distributed in the hope that it will be useful, |
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
41bdb6e2 | 12 | Lesser General Public License for more details. |
28f540f4 | 13 | |
41bdb6e2 | 14 | You should have received a copy of the GNU Lesser General Public |
59ba27a6 | 15 | License along with the GNU C Library; if not, see |
5a82c748 | 16 | <https://www.gnu.org/licenses/>. */ |
28f540f4 RM |
17 | |
18 | /* Useful declarations and support functions for MiG-generated stubs. */ | |
19 | ||
20 | #ifndef _MACH_MIG_SUPPORT_H | |
21 | ||
22 | #define _MACH_MIG_SUPPORT_H 1 | |
23 | ||
24 | #include <mach/std_types.h> | |
25 | #include <mach/message.h> | |
26 | #include <sys/types.h> | |
27 | #include <string.h> | |
28 | ||
29 | /* MiG initialization. */ | |
30 | extern void __mig_init (void *__first); | |
31 | extern void mig_init (void *__first); | |
32 | ||
33 | /* Shorthand functions for vm_allocate and vm_deallocate on | |
34 | mach_task_self () (and with ANYWHERE=1). */ | |
35 | extern void __mig_allocate (vm_address_t *__addr_p, vm_size_t __size); | |
36 | extern void mig_allocate (vm_address_t *__addr_p, vm_size_t __size); | |
37 | extern void __mig_deallocate (vm_address_t __addr, vm_size_t __size); | |
38 | extern void mig_deallocate (vm_address_t __addr, vm_size_t __size); | |
39 | ||
40 | /* Reply-port management support functions. */ | |
41 | extern void __mig_dealloc_reply_port (mach_port_t); | |
42 | extern void mig_dealloc_reply_port (mach_port_t); | |
43 | extern mach_port_t __mig_get_reply_port (void); | |
44 | extern mach_port_t mig_get_reply_port (void); | |
45 | extern void __mig_put_reply_port (mach_port_t); | |
46 | extern void mig_put_reply_port (mach_port_t); | |
47 | ||
48 | extern void __mig_reply_setup (const mach_msg_header_t *__request, | |
49 | mach_msg_header_t *__reply); | |
50 | extern void mig_reply_setup (const mach_msg_header_t *__request, | |
51 | mach_msg_header_t *__reply); | |
52 | ||
53 | /* Idiocy support function. */ | |
8a0746ae RM |
54 | extern vm_size_t mig_strncpy (char *__dst, const char *__src, vm_size_t __len); |
55 | extern vm_size_t __mig_strncpy (char *__dst, const char *__src, vm_size_t); | |
28f6186f ST |
56 | |
57 | #if defined __USE_EXTERN_INLINES && defined _LIBC | |
b037a293 | 58 | __extern_inline vm_size_t |
28f540f4 RM |
59 | __mig_strncpy (char *__dst, const char *__src, vm_size_t __len) |
60 | { | |
61 | return __stpncpy (__dst, __src, __len) - __dst; | |
62 | } | |
b037a293 | 63 | __extern_inline vm_size_t |
28f540f4 RM |
64 | mig_strncpy (char *__dst, const char *__src, vm_size_t __len) |
65 | { | |
66 | return __mig_strncpy (__dst, __src, __len); | |
67 | } | |
28f6186f | 68 | #endif |
28f540f4 RM |
69 | |
70 | ||
71 | ||
72 | #endif /* mach/mig_support.h */ |