"tar tfv /dev/cd0" speedup patch

Juergen Lock nox at jelal.kn-bremen.de
Sat Feb 20 10:36:48 UTC 2010


On Sat, Feb 20, 2010 at 01:00:40AM -0500, Jung-uk Kim wrote:
> On Saturday 20 February 2010 12:20 am, Tim Kientzle wrote:
> > Juergen,
> >
> > I was looking at your Linux code here and thought
> > the technique of trying lseek(SEEK_END) might work.
> > Unfortunately, it doesn't: lseek(fd, 0, SEEK_END) gives
> > zero for both /dev/sa0 (a tape drive) and /dev/cd0
> > (an optical drive).  Are you sure it works on Linux?
> 
> Can you please try ioctl(fd, BLKGETSIZE64, &some_uint64_var) or 
> ioctl(fd, BLKGETSIZE, &some_u_long_var)?

Yeah I've stumbled across these ioctls in the meantime too, I was
just not sure if all Linux versions currently in use already have
the 64 bit version i.e. BLKGETSIZE64... (since we don't want the
32 bit version for the same reason we don't want 32 bit off_t. :)

 Cheers,
	Juergen


More information about the freebsd-hackers mailing list