Linux has the convention of returning -ERRNO to flag errors from its
system calls. Sometimes other negative values are returned that are
success... However, only values -1 to -4096 (inclusive) are really
errors. The rest are either truncated values that only look negative (so
use long instead of int), or are things like addresses or legal unsigned
file offsets or similar that are successful returns. Filter out the
latter.
Sponsored by: Netflix
(cherry picked from commit 3ae18fdfbcaad827defdc217386e73c993beeba0)
host_syscalls.c: I've written, so put Netflix copyright on. It's
possible in the confusion that Nathan wrote the host_gettimeofday
implementation.
syscall_nr: These files likely can't enjoy copyright protection since
they are just facts (the per-arch Linux system calls), so add a note
they are in the public domain.
Sponsored by: Netflix
(cherry picked from commit 8f7327dceecc225029b17378e4a26ae0b73a0a49)
According to git blame I've 95%+ rewritten this file. Update copyright to
reflect that, but give nod to Nathan for the original I started with.
Sponsored by: Netflix
(cherry picked from commit 2b7918f13c6fce378a75f8247b5dd203bf4a3c5d)