[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
lib/44807: something broken in stat(2)
>Synopsis: something broken in stat(2)
>Arrival-Date: Wed Mar 30 18:15:00 +0000 2011
>Originator: Jukka Ruohonen
>Release: 5.1 - 5.99.48
Another one caught by automated tests.
Something related to stat(2) is seriously broken somewhere. For instance,
opening "/dev/bpf" and stat'ing it either fails or reports odd results.
While I haven't done any analysis, it seems that this might be related to
the old, closed, bugs:
PR kern/37550: fstat(1) not reporting open descriptors properly
PR kern/37878: fdclone(9) suspected of not working well with fstat(1)
Given that those were fixed, it seems that this is again a regression.
To add more weirdness, the following program prints a value 0 on 5.99.48,
but the fstat(2) fails on 5.1.
struct stat st;
int fd, rv;
(void)memset(&st, 0, sizeof(struct stat));
fd = open("/dev/bpf", O_RDONLY);
if (fd < 0)
rv = fstat(fd, &st);
if (rv < 0)
(void)printf("mode = %u\n", st.st_mode);
Main Index |
Thread Index |