NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: kern/57134: fstat on vnd returns empty size
The following reply was made to PR kern/57134; it has been noted by GNATS.
From: Martin Husemann <martin%duskware.de@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc:
Subject: Re: kern/57134: fstat on vnd returns empty size
Date: Mon, 26 Dec 2022 13:33:30 +0100
The code runs via newfs.c:516
fsi = opendisk(special, O_RDONLY, device, sizeof(device), 0);
special = device;
if (fsi < 0 || fstat(fsi, &sb) == -1)
err(1, "%s: open for read", special);
if (S_ISBLK(sb.st_mode)) {
errx(1, "%s is a block device. use raw device",
special);
}
the opendisk works (returns 3) and the fstat also works, but sb has
sb.st_size == 0 (and sb.st_dev == 0xab01, which also looks strange).
Martin
Home |
Main Index |
Thread Index |
Old Index