This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix wordsize-32 mmap offset for negative value (BZ#18877)

On Thu, Aug 27, 2015 at 05:13:13PM -0300, Adhemerval Zanella wrote:
> This patch fixes the default wordsize-32 mmap implementation offset
> calculation for negative values.  Current code uses signed shift
> operation to calculate the multiple size to use with syscall and
> it is implementation defined.  Change it to use a division base
> on mmap page size (default being as before, 4096).
> Tested on armv7hf.
>        [BZ #18877]
>        *  misc/Makefile (tests): Add tst-mmap
>        * sysdeps/unix/sysv/linux/generic/wordsize-32/mmap.c (__mmap): Fix
>        offset calculation for negative values.
>        * misc/tst-mmap.c: New file.

As we have posix/tst-mmap.c already, my idea was to call it

> +  char fname[] = "tst-mmap-offset-XXXXXX";

hence the name of this temporary file.

> -                                   offset >> MMAP_PAGE_SHIFT);
> +                                   offset/MMAP_PAGE_UNIT);



Attachment: pgp47R5QnOe72.pgp
Description: PGP signature

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]