1 .\" Copyright (c) 2019 The FreeBSD Foundation, Inc.
3 .\" This documentation was written by
4 .\" Konstantin Belousov <kib@FreeBSD.org> under sponsorship
5 .\" from the FreeBSD Foundation.
7 .\" Redistribution and use in source and binary forms, with or without
8 .\" modification, are permitted provided that the following conditions
10 .\" 1. Redistributions of source code must retain the above copyright
11 .\" notice, this list of conditions and the following disclaimer.
12 .\" 2. Redistributions in binary form must reproduce the above copyright
13 .\" notice, this list of conditions and the following disclaimer in the
14 .\" documentation and/or other materials provided with the distribution.
16 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 .Nd Control POSIX shared memory segments
63 command manipulates the named POSIX shared memory segments.
64 It allows inspecting existing segments, dumping their metadata or contents,
67 Unlinking removes the name from the system and, when the last process
68 unmaps the segment and closes file descriptor pointing to the segment,
69 frees underlying memory.
71 The number of hard links as displayed by the
73 subcommand, is equal to the number of references to the underlying VM
75 It is almost always equal to the number of mappings +1, except
76 for transient references.
78 The following subcommands are provided:
79 .Bl -tag -width truncate
81 Create segments with the specified paths, if they do not already exist.
85 argument specifies the size of the virtual pages used to map the
88 By default, the system page size is used, but on some platforms a
89 larger page size can be specified.
90 The size of an object backed by large pages must be a multiple of the
94 sysctl variable lists the available page sizes.
96 The optional numerical
98 argument specifies the initial access mode.
100 Unlink the paths specified.
102 List all linked named shared memory segments visible to the caller.
103 For each segment, the user and group owner, size, and path are displayed.
106 option limits the output to segments within the specified
110 Output raw bytes values from the segment to standard output.
112 Print metadata for the specified path, in the format similar to the
116 Change the length of the segments.
119 option specifies new length.
120 The human-friendly 'k', 'm', 'g' suffixes can be used, see
121 .Xr expand_number 3 .
122 If the option is not specified, assumed length is zero.
125 For some commands, the following options may be provided:
128 If specified, requests human-readable display of size, see
129 .Xr humanize_number 3 .
131 Prevent translation of owner and group into symbolic names
132 using name-switch services, instead the raw numeric values are printed.
139 To show content of the shared memory segment with the path
142 .Dl "posixshmcontrol dump /1 | hexdump -C"
144 To create a segment with the path
146 and then enlarge it to 1M, use the sequence of commands
147 .Dl "posixshmcontrol create /2"
148 .Dl "posixshmcontrol truncate -s 1m /2"
159 .Xr expand_number 3 ,
160 .Xr humanize_number 3 ,
161 .Xr shm_create_largepage 3 ,
171 command and this manual page were written by
172 .An Konstantin Belousov Aq Mt kib@freebsd.org
173 under sponsorship from The