opensgx icon indicating copy to clipboard operation
opensgx copied to clipboard

Propagate errno to enclave

Open jonhoo opened this issue 10 years ago • 0 comments

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);
}

jonhoo avatar Jan 12 '16 18:01 jonhoo