make vfs & filesystems use failable copying
[minix3.git] / lib / libsys / sys_safecopy.c
bloba9fae0edddaa2c026fbff35ece4ba4c234db76c1
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.SCP_FROM_TO = src_e;
17 copy_mess.SCP_GID = gr_id;
18 copy_mess.SCP_OFFSET = (long) offset;
19 copy_mess.SCP_ADDRESS = (char *) address;
20 copy_mess.SCP_BYTES = (long) 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.SCP_FROM_TO = dst_e;
37 copy_mess.SCP_GID = gr_id;
38 copy_mess.SCP_OFFSET = (long) offset;
39 copy_mess.SCP_ADDRESS = (char *) address;
40 copy_mess.SCP_BYTES = (long) bytes;
42 return(_kernel_call(SYS_SAFECOPYTO, &copy_mess));