Page MenuHomeFreeBSD

Change mmap(2) to indicate ENOMEM is returned if the requested area is already mapped
Needs ReviewPublic

Authored by felix.the.red_gmail.com on Jun 25 2025, 10:11 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sep 16 2025, 4:39 AM
Unknown Object (File)
Sep 16 2025, 4:28 AM
Unknown Object (File)
Sep 15 2025, 7:52 AM
Unknown Object (File)
Sep 15 2025, 7:11 AM
Unknown Object (File)
Sep 13 2025, 6:14 AM
Unknown Object (File)
Sep 9 2025, 10:22 AM
Unknown Object (File)
Sep 3 2025, 11:33 AM
Unknown Object (File)
Aug 11 2025, 9:58 PM
Subscribers

Details

Reviewers
None
Group Reviewers
manpages
Summary

Change mmap(2) to document that ENOMEM is returned instead of EINVAL in a specific case.

From the original PR:
The man page for mmap(2) says:

[EINVAL]           Both MAP_FIXED and MAP_EXCL were specified, but the
                   requested region is already used by a mapping.

This should be ENOMEM rather than EINVAL.

PR:215469

Test Plan

Attachment with test code

If ENOMEM is returned, the test code will say "Successfully detected clash with ENOMEM" for each successful detection.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

Few points:

  • PR goes in the commit message, i.e. the summary section
  • Test plan should show how I can verify this

That would make this go a lot faster.