Skip to content

Instantly share code, notes, and snippets.

@sangfansh

sangfansh/Enclave.cpp

Last active Jul 11, 2018
Embed
What would you like to do?
#include <stdarg.h>
#include <stdio.h> /* vsnprintf */
#include "Enclave.h"
#include "Enclave_t.h" /* print_string */
/*
* printf:
* Invokes OCALL to display the enclave buffer to the terminal.
*/
void printf(const char *fmt, ...)
{
char buf[BUFSIZ] = {'\0'};
va_list ap;
va_start(ap, fmt);
vsnprintf(buf, BUFSIZ, fmt, ap);
va_end(ap);
ocall_print_string(buf);
}
void printf_helloworld()
{
printf("Hello World\n");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment