From owner-freebsd-hackers@freebsd.org Mon Sep 12 07:12:58 2016 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B380BD74C0 for ; Mon, 12 Sep 2016 07:12:58 +0000 (UTC) (envelope-from phk@phk.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.freebsd.org (Postfix) with ESMTP id 459398DF; Mon, 12 Sep 2016 07:12:57 +0000 (UTC) (envelope-from phk@phk.freebsd.dk) Received: from critter.freebsd.dk (unknown [192.168.55.3]) by phk.freebsd.dk (Postfix) with ESMTP id 56123273AC; Mon, 12 Sep 2016 07:12:50 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.15.2/8.15.2) with ESMTP id u8C7CmM9020587; Mon, 12 Sep 2016 07:12:49 GMT (envelope-from phk@phk.freebsd.dk) To: Matthias Andree cc: freebsd-hackers@freebsd.org Subject: Re: User-space API to inquire block alignment requirements for open file descriptor? In-reply-to: From: "Poul-Henning Kamp" References: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <20585.1473664368.1@critter.freebsd.dk> Content-Transfer-Encoding: quoted-printable Date: Mon, 12 Sep 2016 07:12:48 +0000 Message-ID: <20586.1473664368@critter.freebsd.dk> X-Mailman-Approved-At: Mon, 12 Sep 2016 11:27:40 +0000 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Sep 2016 07:12:58 -0000 -------- In message , 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= .