From owner-svn-src-head@freebsd.org Wed May 29 14:03:54 2019 Return-Path: Delivered-To: svn-src-head@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 499B115C38F4; Wed, 29 May 2019 14:03:54 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8B8E76D88B; Wed, 29 May 2019 14:03:53 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x4TE3o94021106; Wed, 29 May 2019 07:03:50 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x4TE3opc021105; Wed, 29 May 2019 07:03:50 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201905291403.x4TE3opc021105@gndrsh.dnsmgr.net> Subject: Re: svn commit: r348359 - head/usr.bin/posixshmcontrol In-Reply-To: <201905291351.x4TDpJI8015622@repo.freebsd.org> To: Konstantin Belousov Date: Wed, 29 May 2019 07:03:50 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 8B8E76D88B X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.967,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2019 14:03:54 -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. I thought the "All rights reserved." had been removed from all FreeBSD Foundation templates per email from emaste And thank you for the man page and the utility. Regards, Rod > +.\" > +.\" 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. > > -- Rod Grimes rgrimes@freebsd.org