clarify allocation/error return of sockopt_set()

This commit is contained in:
plunky 2008-10-28 12:07:25 +00:00
parent eb89868e67
commit d2d4850456

View File

@ -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