> 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                mo...@rodents-montreal.org
/ \ Email!           7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B

Reply via email to