tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: something really screwed up with mmap+ffs on 5.0_STABLE



> The only difference between the two programs is this:
> #if 1
>         read(fd, buf, BUFSIZE);
>         bmem = (void *)buf;
> #else
>         busmem = mmap(NULL, sb.st_size, PROT_READ, MAP_FILE|MAP_SHARED, fd, 
> 0);
>         if (busmem == MAP_FAILED)
>                 err(1, "mmap");
>         bmem = busmem;
> #endif

Any particular reason to error-check mmap but not read?

Any particular reason to read BUFSIZE bytes but mmap sb.st_size bytes?

/~\ The ASCII                             Mouse
\ / Ribbon Campaign
 X  Against HTML                mouse%rodents-montreal.org@localhost
/ \ Email!           7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B


Home | Main Index | Thread Index | Old Index