Page MenuHomeFreeBSD

Implement shmat(2) flag SHM_REMAP.
ClosedPublic

Authored by kib on Jan 14 2019, 8:24 AM.
Tags
None
Referenced Files
F91537802: D18837.id52848.diff
Mon, Aug 19, 1:42 AM
Unknown Object (File)
Sun, Aug 18, 9:48 AM
Unknown Object (File)
Mon, Aug 12, 8:36 PM
Unknown Object (File)
Sun, Aug 4, 2:06 PM
Unknown Object (File)
Thu, Aug 1, 6:33 PM
Unknown Object (File)
Mon, Jul 29, 6:45 PM
Unknown Object (File)
Mon, Jul 29, 7:55 AM
Unknown Object (File)
Jul 14 2024, 1:38 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.