> On Feb 21, 2024, at 2:52 AM, Sad Clouds <cryintotheblue...@gmail.com> wrote:
> 
> Hello, for most operating systems determining the size of a block
> device can be done with:
> 
> lseek(fd, 0, SEEK_END);

On what operating systems does this do what you claim?

> However, on NetBSD this does not seem to work.

It doesn’t work on macOS, either:

thorpej-mbp:thorpej 541$ sudo ./lseek /dev/disk4
Password:
lseek(fd, 4096, SEEK_SET) = 4096 bytes
lseek(fd, 0, SEEK_END)    = 0 bytes
thorpej-mbp:thorpej 542$ 

-- thorpej

Reply via email to