Пример #1
0
int
call_cheri_fd_write_c(struct cheri_object fd_object)
{
	__capability char *hello_world_buf_c;
	size_t len_buf_c;

	len_buf_c = strlen(hello_world_str_nl);
	hello_world_buf_c = cheri_ptrperm(&hello_world_str_nl, len_buf_c,
	    CHERI_PERM_LOAD); /* Just the text. */
	return (cheri_fd_write_c(fd_object,
	    hello_world_buf_c, len_buf_c).cfr_retval0);
}
Пример #2
0
static int
invoke_fd_write_c(struct cheri_object fd_object)
{
	struct cheri_fd_ret ret;
	const char *buf = "fd write test\n";
	__capability const void *buf_c;

	buf_c = cheri_ptr(buf, strlen(buf));
	ret = cheri_fd_write_c(fd_object, buf_c);
	printf("cheri_fd_write_c returned (%ld, %ld)\n", ret.cfr_retval0,
	    ret.cfr_retval1);
	return (0);
}