2006-06-20 10:45:04 +02:00
|
|
|
|
|
|
|
#include "syslib.h"
|
|
|
|
|
|
|
|
#include <minix/safecopies.h>
|
|
|
|
|
2012-03-25 20:25:53 +02:00
|
|
|
int sys_safecopyfrom(endpoint_t src_e,
|
2006-06-20 10:45:04 +02:00
|
|
|
cp_grant_id_t gr_id, vir_bytes offset,
|
2012-06-16 03:46:15 +02:00
|
|
|
vir_bytes address, size_t bytes)
|
2006-06-20 10:45:04 +02:00
|
|
|
{
|
|
|
|
/* Transfer a block of data for which the other process has previously
|
|
|
|
* given permission.
|
|
|
|
*/
|
|
|
|
|
|
|
|
message copy_mess;
|
|
|
|
|
2014-07-26 13:54:00 +02:00
|
|
|
copy_mess.m_lsys_kern_safecopy.from_to = src_e;
|
|
|
|
copy_mess.m_lsys_kern_safecopy.gid = gr_id;
|
|
|
|
copy_mess.m_lsys_kern_safecopy.offset = offset;
|
|
|
|
copy_mess.m_lsys_kern_safecopy.address = address;
|
|
|
|
copy_mess.m_lsys_kern_safecopy.bytes = bytes;
|
2006-06-20 10:45:04 +02:00
|
|
|
|
2010-02-09 16:20:09 +01:00
|
|
|
return(_kernel_call(SYS_SAFECOPYFROM, ©_mess));
|
2006-06-20 10:45:04 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2012-03-25 20:25:53 +02:00
|
|
|
int sys_safecopyto(endpoint_t dst_e,
|
2006-06-20 10:45:04 +02:00
|
|
|
cp_grant_id_t gr_id, vir_bytes offset,
|
2012-06-16 03:46:15 +02:00
|
|
|
vir_bytes address, size_t bytes)
|
2006-06-20 10:45:04 +02:00
|
|
|
{
|
|
|
|
/* Transfer a block of data for which the other process has previously
|
|
|
|
* given permission.
|
|
|
|
*/
|
|
|
|
|
|
|
|
message copy_mess;
|
|
|
|
|
2014-07-26 13:54:00 +02:00
|
|
|
copy_mess.m_lsys_kern_safecopy.from_to = dst_e;
|
|
|
|
copy_mess.m_lsys_kern_safecopy.gid = gr_id;
|
|
|
|
copy_mess.m_lsys_kern_safecopy.offset = offset;
|
|
|
|
copy_mess.m_lsys_kern_safecopy.address = address;
|
|
|
|
copy_mess.m_lsys_kern_safecopy.bytes = bytes;
|
2006-06-20 10:45:04 +02:00
|
|
|
|
2010-02-09 16:20:09 +01:00
|
|
|
return(_kernel_call(SYS_SAFECOPYTO, ©_mess));
|
2006-06-20 10:45:04 +02:00
|
|
|
|
|
|
|
}
|