[SLOF] [PATCH v3] slof/fs/packages/disk-label.fs: improve checking for DOS boot partitions

Segher Boessenkool segher at kernel.crashing.org
Thu Mar 28 00:43:25 AEDT 2024


Hi!

On Wed, Mar 27, 2024 at 01:41:27AM -0400, Kautuk Consul wrote:
> -\ read sector to array "block"
> -: read-sector ( sector-number -- )
> +\ read sector to array "block" and return actual bytes read
> +: read-sector-ret ( sector-number -- actual-bytes )

What does "-ret" mean?  The name could be clearer.

Why factor it like this, anyway?  Shouldn't "read" always read exactly
the number of bytes it is asked to?  So, "read-sector" should always
read exactly one sector, never more, never less.

If an exception happens you can (should!) throw an exception.  Which
you can then catch at a pretty high level.


Segher


More information about the SLOF mailing list