docs/91149: read(2) can return EINVAL for unaligned access to block devices

Justin T. Gibbs gibbs at tumnus.scsiguy.org
Sat Dec 31 18:10:05 UTC 2005


>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:



More information about the freebsd-doc mailing list