HomeFreeBSD

kboot: For hostfs, return better errors from read, where possible.

Description

kboot: For hostfs, return better errors from read, where possible.

Translate the Linux error return from read to a FreeBSD errno. We use a
simplified translation: 1-34 are the same between the systems, so any of
those will be returned directly. All other errno map to EINVAL. This
will suffice for some code that reads /dev/mem in producing the right
diagnostic.

A fully generalized version is much harder. Linux has a number of errno
that don't translate well and has architecture dependent
encodings. Avoid this mess with a simple macro for now. Add comment
explaining why we use the simple method we do.

Sponsored by: Netflix
Reviewed by: kevans, andrew
Differential Revision: https://reviews.freebsd.org/D38265

Details

Provenance
impAuthored on Feb 2 2023, 8:06 PM
Reviewer
kevans
Differential Revision
D38265: kboot: For hostfs, return better errors from read, where possible.
Parents
rG81d71f94cabc: kboot: Fix hostdisk fmtdev
Branches
Unknown
Tags
Unknown