From 3112e9d48546c4c7b13a53224e8907a102ab2b0e Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Thu, 12 Mar 2009 13:45:55 +0000 Subject: MFC r189283: Correct types of variables used to track amount of allocated SysV shared memory from int to size_t. Implement a workaround for current ABI not allowing to properly save size for and report more then 2GB sized segment of shared memory. This makes it possible to use > 2 GB shared memory segments on 64bit architectures. Please note the new BUGS section in shmctl(2) and UPDATING note for limitations of this temporal solution. MFC r189398: Systematically use vm_size_t to specify the size of the segment for VM KPI. Do not overload the local variable size in kern_shmat() due to vm_size_t change. Fix style bug by adding explicit comparision with 0. MFC r189399: Improve the grammar and wording in the changes to shmctl(2) manpage. Put an UPDATING entry and bump __FreeBSD_version for the change. --- lib/libc/sys/shmctl.2 | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lib/libc') diff --git a/lib/libc/sys/shmctl.2 b/lib/libc/sys/shmctl.2 index 90c61c9a1946..2ac7d0541c11 100644 --- a/lib/libc/sys/shmctl.2 +++ b/lib/libc/sys/shmctl.2 @@ -133,6 +133,16 @@ the shared memory segment's owner or creator. Permission denied due to mismatch between operation and mode of shared memory segment. .El +.Sh "BUGS" +The segment size has size_t type. +The shm_segsz member of the +.Vt shmid_ds +structure has type int, which is too short to represent the full range +of values for a segment size. +If shared memory limits are raised to allow segments with size > 2 GB +to be created, be aware that IPC_STAT call may return a truncated value +for shm_segsz. +.El .Sh "SEE ALSO" .Xr shmat 2 , .Xr shmdt 2 , -- cgit v1.3