Last active
July 11, 2018 19:12
-
-
Save sangfansh/1bbd511db1fe67ce69953a39089d6cee to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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