tech-userlevel archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: Issues with lseek(2) on a block device
On Sat, Feb 24, 2024 at 04:28:28PM -0500, Thor Lancelot Simon wrote:
> > Hello, thanks to everyone who responded with their suggestions. Using
> > various non-portable ioctls I can device size on most platforms, for
> > both block and raw devices.
> >
> > This is more convoluted than a single lseek() call, but it is what it
> > is. If anyone wants to do something similar, then the following example
> > can give you a good start.
>
> Probably not a good idea to start with lseek() because if you _do_
> encounter a tape device, seeking to SEEK_END could take you an extremely
> long time.
Also there at least used to be tapes where if you spun them all the
way to the end you'd unthread the tape onto the take-up spindle and
have to take it out and fix it.
--
David A. Holland
dholland%netbsd.org@localhost
Home |
Main Index |
Thread Index |
Old Index