From owner-freebsd-doc@FreeBSD.ORG Sat Dec 31 18:10:05 2005 Return-Path: X-Original-To: freebsd-doc@hub.freebsd.org Delivered-To: freebsd-doc@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6097416A41F for ; Sat, 31 Dec 2005 18:10:05 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8316E43D5F for ; Sat, 31 Dec 2005 18:10:04 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id jBVIA4t3098119 for ; Sat, 31 Dec 2005 18:10:04 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id jBVIA4UX098118; Sat, 31 Dec 2005 18:10:04 GMT (envelope-from gnats) Resent-Date: Sat, 31 Dec 2005 18:10:04 GMT Resent-Message-Id: <200512311810.jBVIA4UX098118@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-doc@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, "Justin T. Gibbs" Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 99B7616A41F for ; Sat, 31 Dec 2005 18:04:28 +0000 (GMT) (envelope-from gibbs@tumnus.scsiguy.org) Received: from tumnus.scsiguy.org (mail.scsiguy.com [70.89.174.89]) by mx1.FreeBSD.org (Postfix) with ESMTP id 44FEA43D58 for ; Sat, 31 Dec 2005 18:04:27 +0000 (GMT) (envelope-from gibbs@tumnus.scsiguy.org) Received: from tumnus.scsiguy.org (localhost [127.0.0.1]) by tumnus.scsiguy.org (8.13.4/8.13.4) with ESMTP id jBRCK1D3022081 for ; Tue, 27 Dec 2005 12:20:01 GMT (envelope-from gibbs@tumnus.scsiguy.org) Received: (from gibbs@localhost) by tumnus.scsiguy.org (8.13.4/8.13.4/Submit) id jBRCK0S9021884; Tue, 27 Dec 2005 12:20:00 GMT (envelope-from gibbs) Message-Id: <200512271220.jBRCK0S9021884@tumnus.scsiguy.org> Date: Tue, 27 Dec 2005 12:20:00 GMT From: "Justin T. Gibbs" To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: docs/91149: read(2) can return EINVAL for unaligned access to block devices X-BeenThere: freebsd-doc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: "Justin T. Gibbs" List-Id: Documentation project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2005 18:10:05 -0000 >Number: 91149 >Category: docs >Synopsis: read(2) can return EINVAL for unaligned access to block devices >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-doc >State: open >Quarter: >Keywords: >Date-Required: >Class: update >Submitter-Id: current-users >Arrival-Date: Sat Dec 31 18:10:03 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Justin T. Gibbs >Release: FreeBSD 7.0-CURRENT i386 >Organization: >Environment: System: FreeBSD tumnus.scsiguy.org 7.0-CURRENT FreeBSD 7.0-CURRENT #0: Thu Dec 22 18:09:55 UTC 2005 gibbs@:/usr/src/sys/i386/compile/TUMNUS i386 >Description: The read system call will return EINVAL if the current file offset is not a multiple of the block size. The read(2) man page should be updated to reflect this. >How-To-Repeat: Run /usr/ports/security/bcwipe. It attempts to determine a block device's size vi a binary lseek search. The current code does not round down the address passed to lseek to a multiple of the device block size. Notice that subsequent read calls fail with EINVAL. >Fix: Update man page so an examination of kernel code is not required to determine why EINVAL is being returned. :-) >Release-Note: >Audit-Trail: >Unformatted: