HomeFreeBSD

kboot: Create function for error checking.

Description

kboot: Create function for error checking.

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)

Details

Provenance
impAuthored on Mar 11 2024, 8:15 PM
Parents
rG64355a9cb3dc: loader/lua: Remove workaround for command_error
Branches
Unknown
Tags
Unknown