mbox series

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

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

Message

H.J. Lu July 17, 2024, 7:59 a.m. UTC
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                              | 41 +++++++++---
 misc/Makefile                                 |  2 +
 misc/tst-mremap1.c                            | 46 ++++++++++++++
 misc/tst-mremap2.c                            | 54 ++++++++++++++++
 sysdeps/generic/mremap-failure.h              | 26 ++++++++
 sysdeps/unix/sysv/linux/Makefile              |  9 +++
 .../unix/sysv/linux/linux-kernel-version.c    | 62 ++++++++++++++++++
 sysdeps/unix/sysv/linux/linux-support.h       | 38 +++++++++++
 sysdeps/unix/sysv/linux/mremap-failure.h      | 47 ++++++++++++++
 sysdeps/unix/sysv/linux/mremap.c              | 14 ++++-
 sysdeps/unix/sysv/linux/tst-linux-mremap1.c   | 63 +++++++++++++++++++
 11 files changed, 394 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/linux-kernel-version.c
 create mode 100644 sysdeps/unix/sysv/linux/linux-support.h
 create mode 100644 sysdeps/unix/sysv/linux/mremap-failure.h
 create mode 100644 sysdeps/unix/sysv/linux/tst-linux-mremap1.c