code compatibility between normal and geom methods for accessingdisk devices

Poul-Henning Kamp phk at
Sun Jan 25 22:28:09 PST 2004

In message <BDENIKJMJKOAJAMDFLDDCECICAAA.plan_b at>, slick writes:

>	I wrote an fdisk program which uses several read(2) and write(2).

You program needs to realize that disks have sectors.  You cannot
read a single byte from a disk at a time, you need to read an entire
sector and pick the byte out you want.

Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk at 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.

More information about the freebsd-hackers mailing list