On Wednesday 03 March 2010 11:18:05 am John Baldwin wrote: > Author: jhb > Date: Wed Mar 3 16:18:04 2010 > New Revision: 204638 > URL: http://svn.freebsd.org/changeset/base/204638 > > Log: > Allow lseek(SEEK_END) to work on disk devices by using the DIOCGMEDIASIZE > to determine the media size.
I tried changing devfs_getattr() to return the media size in va_size at Bruce's suggestion, but that ended up not being safe. Specifically, one can only issue DIOCGMEDIASIZE safely if one has an open file handle on a device, and a plain stat(2) (vs fstat(2) or lseek(2)) invokes VOP_GETATTR() without having the file open. -- John Baldwin _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"