Page MenuHomeFreeBSD

munmap.2: Add STANDARDS and note about portability
ClosedPublic

Authored by emaste on Jan 16 2025, 1:13 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sep 13 2025, 4:13 AM
Unknown Object (File)
Sep 7 2025, 4:37 AM
Unknown Object (File)
Sep 2 2025, 8:15 PM
Unknown Object (File)
Aug 25 2025, 10:14 PM
Unknown Object (File)
Aug 15 2025, 5:11 AM
Unknown Object (File)
Aug 9 2025, 11:38 AM
Unknown Object (File)
Jul 31 2025, 9:32 PM
Unknown Object (File)
Jul 5 2025, 4:47 PM
Subscribers

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

emaste created this revision.

Is the same true of len?

This revision is now accepted and ready to land.Jan 16 2025, 5:36 PM

2004 has:

The munmap() function shall fail if:

[EINVAL]
    Addresses in the range [addr,addr+len) are outside the valid range for the address space of a process.
[EINVAL]
    The len argument is 0.
[EINVAL]
    The addr argument is not a multiple of the page size as returned by sysconf().

Unaligned addr moved from shall to may in 2008 AFAICT. I don't have a good enough handle on the variety of systems to know if any require aligned len, but AFAICT POSIX hasn't specified that.

lib/libsys/munmap.2
76

"is aligned to the page size"
would have been better.

lib/libsys/munmap.2
76

Indeed, but I took the language that POSIX uses