From owner-svn-src-all@freebsd.org Wed May 29 13:51:20 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A50315C34A5; Wed, 29 May 2019 13:51:20 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A03506D024; Wed, 29 May 2019 13:51:19 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 79F0D28C0; Wed, 29 May 2019 13:51:19 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4TDpJPD015623; Wed, 29 May 2019 13:51:19 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4TDpJI8015622; Wed, 29 May 2019 13:51:19 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201905291351.x4TDpJI8015622@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 29 May 2019 13:51:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348359 - head/usr.bin/posixshmcontrol X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/usr.bin/posixshmcontrol X-SVN-Commit-Revision: 348359 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A03506D024 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2019 13:51:20 -0000 Author: kib Date: Wed May 29 13:51:18 2019 New Revision: 348359 URL: https://svnweb.freebsd.org/changeset/base/348359 Log: Add posixshmcontrol(1) page. Reviewed by: emaste With input by: danfe Sponsored by: The FreeBSD Foundation (kib) MFC after: 1 week Differential revision: https://reviews.freebsd.org/D20430 Added: head/usr.bin/posixshmcontrol/posixshmcontrol.1 (contents, props changed) Modified: head/usr.bin/posixshmcontrol/Makefile Modified: head/usr.bin/posixshmcontrol/Makefile ============================================================================== --- head/usr.bin/posixshmcontrol/Makefile Wed May 29 13:47:10 2019 (r348358) +++ head/usr.bin/posixshmcontrol/Makefile Wed May 29 13:51:18 2019 (r348359) @@ -3,6 +3,5 @@ PROG= posixshmcontrol LIBADD= util WARNS?= 6 -MAN= .include Added: head/usr.bin/posixshmcontrol/posixshmcontrol.1 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/posixshmcontrol/posixshmcontrol.1 Wed May 29 13:51:18 2019 (r348359) @@ -0,0 +1,153 @@ +.\" Copyright (c) 2019 The FreeBSD Foundation, Inc. +.\" All rights reserved. +.\" +.\" This documentation was written by +.\" Konstantin Belousov under sponsorship +.\" from the FreeBSD Foundation. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd May 27, 2019 +.Dt POSIXSHMCONTROL 1 +.Os +.Sh NAME +.Nm posixshmcontrol +.Nd Control POSIX shared memory segments +.Sh SYNOPSIS +.Nm +.Ar create +.Op Fl m Ar mode +.Op Pa path \&... +.Nm +.Ar rm +.Op Pa path \&... +.Nm +.Ar ls +.Op Fl h +.Op Fl n +.Nm +.Ar dump +.Op Pa path \&... +.Nm +.Ar stat +.Op Fl h +.Op Fl n +.Op Pa path \&... +.Nm +.Ar truncate +.Op Fl s Ar length +.Op Pa path \&... +.Sh DESCRIPTION +The +.Nm +command manipulates the named POSIX shared memory segments. +It allows inspecting existing segments, dumping their metadata or contents, +and unlinking them. +.Pp +Unlinking removes the name from the system and, when the last process +unmaps the segment and closes file descriptor pointing to the segment, +frees underlying memory. +.Pp +The number of hard links as displayed by the +.Ic stat +subcommand, is equal to the number of references to the underlying VM +object. +It is almost always equal to the number of mappings +1, except +for transient references. +.Pp +The following subcommands are provided: +.Bl -tag -width truncate +.It Ic create +Create segments with the specified paths, if not exist. +The +.Ar mode +optional numerical argument specifies initial access mode. +.It Ic rm +Unlink the paths specified. +.It Ic ls +List all linked named shared memory segments visible to the caller. +For each segment, the user and group owner, size, and path are displayed. +.It Ic dump +Output raw bytes values from the segment to standard output. +.It Ic stat +Print metadata for the specified path, in the format similar to the +.Xr stat 1 +utility. +.It Ic truncate +Change the length of the segments. +Argument to the +.Fl s +option specifies new length, the human-friendly 'k', 'm', 'g' suffixes +can be used, see +.Xr expand_number 3. +If the option is not specified, assumed length is zero. +.El +.Pp +For some commands, the following options may be provided: +.Bl -tag XX +.It Fl h +If specified, requests human-readable display of size, see +.Xr humanize_number 3 . +.It Fl n +Prevent translation of owner and group into symbolic names +using name-switch services, instead the raw numeric values are printed. +.El +.Sh EXIT STATUS +.Ex -std +.Sh EXAMPLES +.Bl -bullet +.It +To show content of the shared memory segment with the path +.Pa /1 , +use the command +.Dl "posixshmcontrol dump /q | hexdump -C" +.It +To create a segment with the path +.Pa /2 +and then enlarge it to 1M, use the sequence of commands +.Dl "posixshmcontrol create /2" +.Dl "posixshmcontrol truncate -s 1m /2" +.El +.Sh SEE ALSO +.Xr hexdump 1 , +.Xr stat 1 , +.Xr ftruncate 2 , +.Xr read 2 , +.Xr shm_open 2 , +.Xr shm_unlink 2 , +.Xr stat 2 , +.Xr expand_number 3 , +.Xr humanize_number 3 , +.Xr sysctl 3 +.Sh HISTORY +The +.Nm +command appeared in +.Fx 13.0 . +.Sh AUTHORS +The +.Nm +command and this manual page were written by +.An Konstantin Belousov Aq Mt kib@freebsd.org +under sponsorship from The FreeBSD Foundation.