mbox series

[v4,0/3] linux: Update the mremap C implementation [BZ #31968]

Message ID 20240724210515.473004-1-hjl.tools@gmail.com
Headers show
Series linux: Update the mremap C implementation [BZ #31968] | expand

Message

H.J. Lu July 24, 2024, 9:05 p.m. UTC
Changes in v4:

1. Update mremap manual entry to mention MREMAP_DONTUNMAP is Linux-specific.
2. Remove linux-support.h.

Changes in v3:

1. Since MREMAP_FIXED was added to Linux kernel 2.3.31 and MREMAP_DONTUNMAP
was added to Linux kernel 5.7, mark test failure if MREMAP_FIXED and
MREMAP_DONTUNMAP tests fail on supported Linux kernel.

Changes in v2:

1. Update mremap manual entry.
2. Remove linux-support.h.
3. Split a single mremap test into 3 separate tests.

---
1. Update the mremap C implementation to support the optional argument for
MREMAP_DONTUNMAP added in Linux 5.7 since it may not always be correct
to implement a variadic function as a non-variadic function on all Linux
targets.  Return MAP_FAILED and set errno to EINVAL for unknown flag bits.
2. Update mremap manual entry.
3. Add tests for MREMAP_MAYMOVE and MREMAP_FIXED.  On Linux, also test
MREMAP_DONTUNMAP.

H.J. Lu (3):
  linux: Update the mremap C implementation [BZ #31968]
  mremap: Update manual entry
  Add mremap tests

 manual/llio.texi                            | 42 +++++++++++---
 misc/Makefile                               |  2 +
 misc/tst-mremap1.c                          | 46 +++++++++++++++
 misc/tst-mremap2.c                          | 54 ++++++++++++++++++
 sysdeps/generic/mremap-failure.h            | 25 ++++++++
 sysdeps/unix/sysv/linux/Makefile            |  1 +
 sysdeps/unix/sysv/linux/mremap-failure.h    | 30 ++++++++++
 sysdeps/unix/sysv/linux/mremap.c            | 14 ++++-
 sysdeps/unix/sysv/linux/tst-linux-mremap1.c | 63 +++++++++++++++++++++
 9 files changed, 269 insertions(+), 8 deletions(-)
 create mode 100644 misc/tst-mremap1.c
 create mode 100644 misc/tst-mremap2.c
 create mode 100644 sysdeps/generic/mremap-failure.h
 create mode 100644 sysdeps/unix/sysv/linux/mremap-failure.h
 create mode 100644 sysdeps/unix/sysv/linux/tst-linux-mremap1.c