cryintotheblue...@gmail.com (Sad Clouds) writes:
>Hello, for most operating systems determining the size of a block
>device can be done with:
>lseek(fd, 0, SEEK_END);
>However, on NetBSD this does not seem to work.
The disk size is only retrieved at open time and stored in the
cached vnode.
On Wed, 21 Feb 2024 12:48:34 -0800
Jason Thorpe wrote:
>
> > On Feb 21, 2024, at 2:52 AM, Sad Clouds 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
On Wed, Feb 21, 2024 at 09:20:55PM +, Taylor R Campbell wrote:
> But it's a little annoying to make that happen because it requires
> going through all the file systems that have device nodes and
> convincing their VOP_GETATTR implementations to do something different
> for block devices
(This should really be on tech-kern…)
> On Feb 21, 2024, at 1:20 PM, Taylor R Campbell
> wrote:
>
>> Date: Wed, 21 Feb 2024 10:52:55 +
>> From: Sad Clouds
>>
>> Hello, for most operating systems determining the size of a block
>> device can be done with:
>>
>> lseek(fd, 0, SEEK_END);
>>
> Date: Wed, 21 Feb 2024 10:52:55 +
> From: Sad Clouds
>
> Hello, for most operating systems determining the size of a block
> device can be done with:
>
> lseek(fd, 0, SEEK_END);
>
> However, on NetBSD this does not seem to work.
Internally, this is happens for more or less the same
> On Feb 21, 2024, at 2:52 AM, Sad Clouds 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
Hello, for most operating systems determining the size of a block
device can be done with:
lseek(fd, 0, SEEK_END);
However, on NetBSD this does not seem to work.
#include
#include
#include
#include
#include
int main(void)
{
int fd;
off_t offset;
fd =