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)
Mon, Mar 17, 5:33 AM
Unknown Object (File)
Wed, Mar 5, 7:58 AM
Unknown Object (File)
Mon, Mar 3, 3:31 AM
Unknown Object (File)
Feb 14 2025, 1:32 PM
Unknown Object (File)
Feb 14 2025, 1:31 PM
Unknown Object (File)
Jan 28 2025, 7:47 AM
Unknown Object (File)
Jan 28 2025, 7:47 AM
Unknown Object (File)
Jan 28 2025, 7:47 AM
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