From owner-svn-src-all@FreeBSD.ORG Sat Dec 17 06:57:36 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F625106566B; Sat, 17 Dec 2011 06:57:36 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 741888FC08; Sat, 17 Dec 2011 06:57:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pBH6vaw2047059; Sat, 17 Dec 2011 06:57:36 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pBH6vaSt047057; Sat, 17 Dec 2011 06:57:36 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201112170657.pBH6vaSt047057@svn.freebsd.org> From: Ruslan Ermilov Date: Sat, 17 Dec 2011 06:57:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r228620 - head/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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: Sat, 17 Dec 2011 06:57:36 -0000 Author: ru Date: Sat Dec 17 06:57:35 2011 New Revision: 228620 URL: http://svn.freebsd.org/changeset/base/228620 Log: Fixed some of markup. Reviewed by: jhb Modified: head/share/man/man9/shm_map.9 Modified: head/share/man/man9/shm_map.9 ============================================================================== --- head/share/man/man9/shm_map.9 Sat Dec 17 02:23:30 2011 (r228619) +++ head/share/man/man9/shm_map.9 Sat Dec 17 06:57:35 2011 (r228620) @@ -30,9 +30,8 @@ .Dt SHM_MAP 9 .Os .Sh NAME -.Nm shm_map , -.Nm shm_unmap -.Nd map shared memory objects into the kernel's address space +.Nm shm_map , shm_unmap +.Nd "map shared memory objects into the kernel's address space" .Sh SYNOPSIS .In sys/types.h .In sys/mman.h @@ -42,9 +41,9 @@ .Fn shm_unmap "struct file *fp" "void *mem" "size_t size" .Sh DESCRIPTION The -.Nm shm_map +.Fn shm_map and -.Nm shm_unmap +.Fn shm_unmap functions provide an API for mapping shared memory objects into the kernel. Shared memory objects are created by .Xr shm_open 2 . @@ -57,13 +56,13 @@ Shared memory objects can still be grown .Pp To simplify the accounting needed to enforce the above requirement, callers of this API are required to unmap the entire region mapped by -.Nm shm_map +.Fn shm_map when calling -.Nm shm_unmap . +.Fn shm_unmap . Unmapping only a portion of the region is not permitted. .Pp The -.Nm shm_map +.Fn shm_map function locates the shared memory object associated with the open file .Fa fp . It maps the region of that object described by @@ -77,9 +76,9 @@ will be set to the start of the mapping. All pages for the range will be wired into memory upon successful return. .Pp The -.Nm shm_unmap +.Fn shm_unmap function unmaps a region previously mapped by -.Nm shm_map . +.Fn shm_map . The .Fa mem argument should match the value previously returned in @@ -87,22 +86,22 @@ argument should match the value previous and the .Fa size argument should match the value passed to -.Nm shm_map . +.Fn shm_map . .Pp Note that -.Nm shm_map +.Fn shm_map will not hold an extra reference on the open file .Fa fp for the lifetime of the mapping. Instead, the calling code is required to do this if it wishes to use -.Nm shm_unmap +.Fn shm_unmap on the region in the future. .Sh RETURN VALUES The -.Nm shm_map +.Fn shm_map and -.Nm shm_unmap +.Fn shm_unmap functions return zero on success or an error on failure. .Sh EXAMPLES The following function accepts a file descriptor for a shared memory @@ -110,7 +109,7 @@ object. It maps the first sixteen kilobytes of the object into the kernel, performs some work on that address, and then unmaps the address before returning. -.Bd -literal +.Bd -literal -offset indent int shm_example(int fd) { @@ -118,7 +117,7 @@ shm_example(int fd) void *mem; int error; - error = fget(curthread, fd, CAP_MMAP, &fp) + error = fget(curthread, fd, CAP_MMAP, &fp); if (error) return (error); error = shm_map(fp, 16384, 0, &mem); @@ -136,7 +135,7 @@ shm_example(int fd) .Ed .Sh ERRORS The -.Nm shm_map +.Fn shm_map function returns the following errors on failure: .Bl -tag -width Er .It Bq Er EINVAL @@ -158,7 +157,7 @@ The shared memory object could not be ma .El .Pp The -.Nm shm_unmap +.Fn shm_unmap function returns the following errors on failure: .Bl -tag -width Er .It Bq Er EINVAL