提交 196cf5ad 编写于 作者: jia zhang's avatar jia zhang

rune/libenclave: Work around nanosleep() issue

nanosleep() may return the remaining duration longer than
requested one due to timer slack.
Signed-off-by: jia zhang's avatarJia Zhang <zhang.jia@linux.alibaba.com>
上级 2dcb2023
package enclave_runtime_pal // import "github.com/opencontainers/runc/libenclave/internal/runtime/pal" package enclave_runtime_pal // import "github.com/opencontainers/runc/libenclave/internal/runtime/pal"
/*
#include <sys/prctl.h>
static void workaround_nanosleep(void) {
// nanosleep() may return the remaining duration longer than
// requested one due to timer slack.
prctl(PR_SET_TIMERSLACK, 1, 0, 0, 0);
}
*/
import "C" import "C"
import ( import (
...@@ -26,6 +35,8 @@ func (pal *enclaveRuntimePal) Init(args string, logLevel string) error { ...@@ -26,6 +35,8 @@ func (pal *enclaveRuntimePal) Init(args string, logLevel string) error {
} }
pal.version = ver pal.version = ver
C.workaround_nanosleep();
return api.init(args, logLevel) return api.init(args, logLevel)
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册