libsys: add sys_safememset()
This commit is contained in:
parent
d8a89dcbe6
commit
bf33a1c097
4 changed files with 27 additions and 4 deletions
|
@ -147,6 +147,9 @@ int sys_safecopyto(endpoint_t dest, cp_grant_id_t grant, vir_bytes
|
|||
grant_offset, vir_bytes my_address, size_t bytes);
|
||||
int sys_vsafecopy(struct vscp_vec *copyvec, int elements);
|
||||
|
||||
int sys_safememset(endpoint_t source, cp_grant_id_t grant, vir_bytes
|
||||
grant_offset, int pattern, size_t bytes);
|
||||
|
||||
int sys_memset(endpoint_t who, unsigned long pattern,
|
||||
phys_bytes base, phys_bytes bytes);
|
||||
|
||||
|
|
|
@ -53,6 +53,7 @@ SRCS= \
|
|||
sys_runctl.c \
|
||||
sys_safecopy.c \
|
||||
sys_safemap.c \
|
||||
sys_safememset.c \
|
||||
sys_schedctl.c \
|
||||
sys_schedule.c \
|
||||
sys_setalarm.c \
|
||||
|
|
19
lib/libsys/sys_safememset.c
Normal file
19
lib/libsys/sys_safememset.c
Normal file
|
@ -0,0 +1,19 @@
|
|||
#include "syslib.h"
|
||||
|
||||
#include <minix/safecopies.h>
|
||||
|
||||
int sys_safememset(endpoint_t dst_e, cp_grant_id_t gr_id,
|
||||
vir_bytes offset, int pattern, size_t len)
|
||||
{
|
||||
/* memset() a block of data using pattern */
|
||||
|
||||
message copy_mess;
|
||||
|
||||
copy_mess.SMS_DST = dst_e;
|
||||
copy_mess.SMS_GID = gr_id;
|
||||
copy_mess.SMS_OFFSET = (long) offset;
|
||||
copy_mess.SMS_PATTERN = pattern;
|
||||
copy_mess.SMS_BYTES = (long) len;
|
||||
|
||||
return(_kernel_call(SYS_SAFEMEMSET, ©_mess));
|
||||
}
|
Loading…
Reference in a new issue