opensgx
opensgx copied to clipboard
Propagate errno to enclave
When a system call fails, it should be possible to read the error out of errno. However, this doesn't seem to propagate through the trampoline and into the enclave? This makes patterns like eager-reading very difficult:
bytes = recv(s, buf, sizeof(buf), MSG_DONTWAIT);
if (bytes < 0 && errno == EAGAIN) {
/* no data for now, wait for any byte */
bytes = read(s, buf, 1);
}