Page MenuHomeFreeBSD

Implement shmat(2) flag SHM_REMAP.
ClosedPublic

Authored by kib on Jan 14 2019, 8:24 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Nov 14, 2:02 AM
Unknown Object (File)
Sun, Oct 27, 3:30 PM
Unknown Object (File)
Sun, Oct 27, 3:28 PM
Unknown Object (File)
Sun, Oct 27, 2:28 PM
Unknown Object (File)
Sun, Oct 27, 12:58 PM
Unknown Object (File)
Sep 30 2024, 3:23 AM
Unknown Object (File)
Sep 30 2024, 3:23 AM
Unknown Object (File)
Sep 30 2024, 3:14 AM

Details

Summary

Based on the description in Linux man page.

Sponsored by: Mellanox Technologies

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kib edited the summary of this revision. (Show Details)

Bump man page date.

This seems ok to me. I'm not sure about modifying the NetBSD tests, might be nice to wrap the changes with #ifdef SHM_REMAP if they are to be upstreamed.

Seems like in the future we could implement MAP_REMAP with find_space != VMFS_NO_SPACE to provide the semantics needed for Linux's mremap(2).

lib/libc/sys/shmat.2
84 ↗(On Diff #52823)

"is specified and the passed"

86 ↗(On Diff #52823)

"existing mappings"?

90 ↗(On Diff #52823)

addresses -> address

I would also s/already has/contains/.

Fix grammar.
Wrap new test with #ifdef SHM_REMAP.
Document ENOMEM.

The test changes are ok. I figure I'll have to make a pass over the tree anyhow to find what all may have changed in the past year under contrib/netbsd-tests, so there's no time like the present-ish to do it.

contrib/netbsd-tests/kernel/t_sysv.c
864 ↗(On Diff #52848)

Hmmm... 4160 is a curious number (this is copied from other tests, so the voodoo-ness comes from NetBSD).

This revision is now accepted and ready to land.Jan 15 2019, 8:17 AM
lib/libc/sys/shmat.2
86 ↗(On Diff #52848)

.Dv NULL should be used instead of NULL here and elsewhere, since it's a constant.

markj added inline comments.
lib/libc/sys/shmat.2
127 ↗(On Diff #52848)

"due to the amount of available space being smaller"

128 ↗(On Diff #52848)

"pre-existing mappings are in the range"

This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state Needs Review.Jan 16 2019, 5:16 AM
This revision was automatically updated to reflect the committed changes.