etc/services - sync with NetBSD-8
[minix.git] / minix / lib / libsys / sys_safecopy.c
blob1b097b24db4d734ec13cbb41cd3a26e58cddd2e9
2 #include "syslib.h"
4 #include <minix/safecopies.h>
6 int sys_safecopyfrom(endpoint_t src_e,
7 cp_grant_id_t gr_id, vir_bytes offset,
8 vir_bytes address, size_t bytes)
10 /* Transfer a block of data for which the other process has previously
11 * given permission.
14 message copy_mess;
16 copy_mess.m_lsys_kern_safecopy.from_to = src_e;
17 copy_mess.m_lsys_kern_safecopy.gid = gr_id;
18 copy_mess.m_lsys_kern_safecopy.offset = offset;
19 copy_mess.m_lsys_kern_safecopy.address = (void *)address;
20 copy_mess.m_lsys_kern_safecopy.bytes = bytes;
22 return(_kernel_call(SYS_SAFECOPYFROM, &copy_mess));
26 int sys_safecopyto(endpoint_t dst_e,
27 cp_grant_id_t gr_id, vir_bytes offset,
28 vir_bytes address, size_t bytes)
30 /* Transfer a block of data for which the other process has previously
31 * given permission.
34 message copy_mess;
36 copy_mess.m_lsys_kern_safecopy.from_to = dst_e;
37 copy_mess.m_lsys_kern_safecopy.gid = gr_id;
38 copy_mess.m_lsys_kern_safecopy.offset = offset;
39 copy_mess.m_lsys_kern_safecopy.address = (void *)address;
40 copy_mess.m_lsys_kern_safecopy.bytes = bytes;
42 return(_kernel_call(SYS_SAFECOPYTO, &copy_mess));