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
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 /* for older kernels that still need the 'seg' field
23 * provide the right value.
25 copy_mess
.SCP_SEG_OBSOLETE
= D_OBSOLETE
;
27 return(_kernel_call(SYS_SAFECOPYFROM
, ©_mess
));
31 int sys_safecopyto(endpoint_t dst_e
,
32 cp_grant_id_t gr_id
, vir_bytes offset
,
33 vir_bytes address
, size_t bytes
)
35 /* Transfer a block of data for which the other process has previously
41 copy_mess
.SCP_FROM_TO
= dst_e
;
42 copy_mess
.SCP_GID
= gr_id
;
43 copy_mess
.SCP_OFFSET
= (long) offset
;
44 copy_mess
.SCP_ADDRESS
= (char *) address
;
45 copy_mess
.SCP_BYTES
= (long) bytes
;
47 /* for older kernels that still need the 'seg' field
48 * provide the right value.
50 copy_mess
.SCP_SEG_OBSOLETE
= D_OBSOLETE
;
52 return(_kernel_call(SYS_SAFECOPYTO
, ©_mess
));