From owner-svn-src-stable-11@freebsd.org Sun Sep 10 20:13:21 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1DB6E00182; Sun, 10 Sep 2017 20:13:21 +0000 (UTC) (envelope-from ian@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 mx1.freebsd.org (Postfix) with ESMTPS id BEC2984DA0; Sun, 10 Sep 2017 20:13:21 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8AKDKq0092364; Sun, 10 Sep 2017 20:13:20 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8AKDKsO092362; Sun, 10 Sep 2017 20:13:20 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201709102013.v8AKDKsO092362@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 10 Sep 2017 20:13:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r323395 - stable/11/share/man/man9 X-SVN-Group: stable-11 X-SVN-Commit-Author: ian X-SVN-Commit-Paths: stable/11/share/man/man9 X-SVN-Commit-Revision: 323395 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Sep 2017 20:13:22 -0000 Author: ian Date: Sun Sep 10 20:13:20 2017 New Revision: 323395 URL: https://svnweb.freebsd.org/changeset/base/323395 Log: MFC r315089: Document uiomove_frombuf(9). Modified: stable/11/share/man/man9/Makefile stable/11/share/man/man9/uio.9 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man9/Makefile ============================================================================== --- stable/11/share/man/man9/Makefile Sun Sep 10 19:12:01 2017 (r323394) +++ stable/11/share/man/man9/Makefile Sun Sep 10 20:13:20 2017 (r323395) @@ -1791,6 +1791,7 @@ MLINKS+=uidinfo.9 uifind.9 \ uidinfo.9 uihashinit.9 \ uidinfo.9 uihold.9 MLINKS+=uio.9 uiomove.9 \ + uio.9 uiomove_frombuf.9 \ uio.9 uiomove_nofault.9 .if ${MK_USB} != "no" Modified: stable/11/share/man/man9/uio.9 ============================================================================== --- stable/11/share/man/man9/uio.9 Sun Sep 10 19:12:01 2017 (r323394) +++ stable/11/share/man/man9/uio.9 Sun Sep 10 20:13:20 2017 (r323395) @@ -25,12 +25,13 @@ .\" .\" $FreeBSD$ .\" -.Dd January 19, 2012 +.Dd March 11, 2017 .Dt UIO 9 .Os .Sh NAME .Nm uio , .Nm uiomove , +.Nm uiomove_frombuf , .Nm uiomove_nofault .Nd device driver I/O routines .Sh SYNOPSIS @@ -50,10 +51,13 @@ struct uio { .Ft int .Fn uiomove "void *buf" "int howmuch" "struct uio *uiop" .Ft int +.Fn uiomove_frombuf "void *buf" "int howmuch" "struct uio *uiop" +.Ft int .Fn uiomove_nofault "void *buf" "int howmuch" "struct uio *uiop" .Sh DESCRIPTION The functions -.Fn uiomove +.Fn uiomove , +.Fn uiomove_frombuf , and .Fn uiomove_nofault are used to transfer data between buffers and I/O vectors that might @@ -129,9 +133,27 @@ Thus, the function .Fn uiomove_nofault can be called from contexts where acquiring virtual memory system locks or sleeping are prohibited. +.Pp +The +.Fn uiomove_frombuf +function is a convenience wrapper around +.Fn uiomove +for drivers that serve data which is wholly contained within an +existing buffer in memory. +It validates the +.Va uio_offset +and +.Va uio_resid +values against the size of the existing buffer, handling short +transfers when the request partially overlaps the buffer. +When +.Va uio_offset +is greater than or equal to the buffer size, the result is success +with no bytes transfered, effectively signaling EOF. .Sh RETURN VALUES On success -.Fn uiomove +.Fn uiomove , +.Fn uiomove_frombuf , and .Fn uiomove_nofault will return 0; on error they will return an appropriate error code.