瀏覽代碼

[Pal/Linux-SGX] Force ocall_gettime() to loop on EINTR

SGX PAL-level functions like _DkSystemTimeQuery() assume that
ocall_gettime() does not return EINTR. Thus, this commit forces
this ocall to loop on EINTR.
Isaku Yamahata 6 年之前
父節點
當前提交
9a37c5cc36
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      Pal/src/host/Linux-SGX/enclave_ocalls.c

+ 3 - 1
Pal/src/host/Linux-SGX/enclave_ocalls.c

@@ -972,7 +972,9 @@ int ocall_gettime (unsigned long * microsec)
         return -EPERM;
     }
 
-    retval = sgx_ocall(OCALL_GETTIME, ms);
+    do {
+        retval = sgx_ocall(OCALL_GETTIME, ms);
+    } while(retval == -EINTR);
     if (!retval)
         *microsec = ms->ms_microsec;