Linuxolator patches: stat and lseek SEEK_END for disk devices

Juergen Lock nox at jelal.kn-bremen.de
Tue Feb 23 22:00:04 UTC 2010


Hi!

 Before this gets buried on -hackers in another thead... :)

 I now have disks appear as block devices for Linux processes (there
already was commented out code for that in linux_stats.c, I hope my
version is now `correct enough' to be usable [1]), and I made a simple
patch to make lseek SEEK_END (L_XTND in the source) dtrt on disk
devices too by simply invoking the DIOCGMEDIASIZE ioctl there; [2]
both of these things are what (some) Linux processes expect.

 Patches are here: (made on stable/8, if they don't apply on head
I'll have to make extra versions for that...)
	http://people.freebsd.org/~nox/linuxdisk-blk.patch [1]
	http://people.freebsd.org/~nox/lseek-seek_end.patch [2]

 And yes, with these patches the Linux bsdtar mentioned on -hackers
in the `"tar tfv /dev/cd0" speedup patch' thread now also runs fast
on FreeBSD. :)

 Cheers,
	Juergen


More information about the freebsd-emulation mailing list