Yeah omg. Is it cause it's possible to map page 0 therefore returning 0 is valid?
On Tue, Nov 1, 2016, 21:48 barret rhoden <[email protected]> wrote: > On 2016-11-02 at 4:33 ron minnich wrote: > > https://linux.die.net/man/3/explain_mmap > > > > "our kernel only returns error numbers so we wrote an entire new library > to > > tell you what the kernel should have told you in the first place." > > > > the mind reels. > > > > damn. even worse, from the example on that page: > > void *result = mmap(data, data_size, prot, flags, fildes, offset); > if (!result) > { > fprintf(stderr, "%s\n", explain_mmap(data, data_size, prot, flags, > fildes, offset)); > exit(EXIT_FAILURE); > } > > checking !result is wrong. mmap returns MAP_FAILED (basically -1) on > error, not 0. we had a brutal bug a long time ago that got that wrong. > > barret > > > -- > You received this message because you are subscribed to the Google Groups > "Akaros" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Akaros" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. For more options, visit https://groups.google.com/d/optout.
