From d2d4850456f606a443d090d130250cc39c7b01ad Mon Sep 17 00:00:00 2001 From: plunky Date: Tue, 28 Oct 2008 12:07:25 +0000 Subject: [PATCH] clarify allocation/error return of sockopt_set() --- share/man/man9/sockopt.9 | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/share/man/man9/sockopt.9 b/share/man/man9/sockopt.9 index 43415463c786..1fb1a6651c36 100644 --- a/share/man/man9/sockopt.9 +++ b/share/man/man9/sockopt.9 @@ -1,4 +1,4 @@ -.\" $NetBSD: sockopt.9,v 1.3 2008/10/13 08:27:13 wiz Exp $ +.\" $NetBSD: sockopt.9,v 1.4 2008/10/28 12:07:25 plunky Exp $ .\" .\" Copyright (c) 2008 Iain Hibbert .\" All rights reserved. @@ -23,7 +23,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd October 12, 2008 +.Dd October 28, 2008 .Dt SOCKOPT 9 .Os .Sh NAME @@ -111,7 +111,18 @@ allocated using .Xr kmem_alloc 9 with the .Dv KM_NOSLEEP -flag. +flag which may cause +.Fn sockopt_set +to return +.Dv ENOMEM . +.Pp +Note: If you need to use +.Fn sockopt_set +in a context where memory allocation may be required and you do not wish to +contemplate failure, the sockopt structure can be initialised in a more suitable +context using +.Fn sockopt_init +which will not fail. .It Fn sockopt_setint "sopt" "value" Common case of set sockopt integer value. The sockpt structure must contain an int sized data field or be previously