Skip to content

Instantly share code, notes, and snippets.

@sangfansh
Last active July 11, 2018 19:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sangfansh/1bbd511db1fe67ce69953a39089d6cee to your computer and use it in GitHub Desktop.
Save sangfansh/1bbd511db1fe67ce69953a39089d6cee to your computer and use it in GitHub Desktop.
#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