Implement stat and getentropy for sgx with ocall to run tensorflow (#436)

This commit is contained in:
Wenyong Huang
2020-10-30 12:36:00 +08:00
committed by GitHub
parent ed94b7dcc4
commit 667282eea9
4 changed files with 54 additions and 2 deletions

View File

@ -130,6 +130,12 @@ int ocall_closedir(void* dirp)
return -1;
}
int ocall_stat(const char *pathname,
void *buf, unsigned int buf_len)
{
return stat(pathname, (struct stat *)buf);
}
int ocall_fstat(int fd, void *buf, unsigned int buf_len)
{
return fstat(fd, (struct stat *)buf);
@ -277,6 +283,11 @@ ssize_t ocall_getrandom(void *buf, size_t buflen, unsigned int flags)
return getrandom(buf, buflen, flags);
}
int ocall_getentropy(void *buffer, size_t length)
{
return getentropy(buffer, length);
}
int ocall_sched_yield()
{
return sched_yield();