Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 Oct 2003 17:46:51 -0400 (EDT)
From:      Garrett Wollman <wollman@khavrinen.lcs.mit.edu>
To:        phk@phk.freebsd.dk
Cc:        arch@FreeBSD.org
Subject:   Re: Alignment of disk-I/O from userland.
Message-ID:  <200310062146.h96Lkpx0093486@khavrinen.lcs.mit.edu>
In-Reply-To: <21229.1065441969@critter.freebsd.dk>

next in thread | previous in thread | raw e-mail | index | archive | help
PHK writes:

>Most code which does disk I/O from userland uses malloc'ed buffers for
>the sectors and the alignment comes for free, but we currently have
>no requirement that it be so.

I believe that the Standard allows practically arbitrary restrictions
on what may be done with devices (since most devices, aside from ttys,
are outside the scope of the Standard anyway).  It says that read()
may fail if:

[ENXIO]    A request was made of a nonexistent device, or the request
	   was outside the capabilities of the device.

(I'm assuming you're talking about reads from devices, as opposed to
reads from files.)

I think that gives us plenary authority to require appropriate
alignment of data buffers used to access disk devices directly.

-GAWollman



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200310062146.h96Lkpx0093486>