Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Sep 2016 07:12:48 +0000
From:      "Poul-Henning Kamp" <phk@phk.freebsd.dk>
To:        Matthias Andree <mandree@FreeBSD.org>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: User-space API to inquire block alignment requirements for open file descriptor?
Message-ID:  <20586.1473664368@critter.freebsd.dk>
In-Reply-To: <c9063edd-a3c1-fce4-483c-a192addc6b86@FreeBSD.org>
References:  <c9063edd-a3c1-fce4-483c-a192addc6b86@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
--------
In message <c9063edd-a3c1-fce4-483c-a192addc6b86@FreeBSD.org>, Matthias An=
dree =

writes:
>Greetings,
>
>given an open file descriptor, do we have a system interface to inquire
>about the block size of the underlying devices? In the past, we used to
>deal with 512-byte blocks, but how about drives using 4096-byte blocks?

DIOCGSECTORSIZE in sys/disk.h

-- =

Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk@FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    =

Never attribute to malice what can adequately be explained by incompetence=
.



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