xref: /netbsd-src/lib/libc/net/sctp_getaddrlen.3 (revision c9911a308e544f9996ca8c1b3d55033e1670fc78)
1.\"	$NetBSD: sctp_getaddrlen.3,v 1.2 2018/08/13 06:00:21 wiz Exp $
2.\"
3.\" Copyright (c) 1983, 1991, 1993
4.\"	The Regents of the University of California.  All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\" 3. Neither the name of the University nor the names of its contributors
15.\"    may be used to endorse or promote products derived from this software
16.\"    without specific prior written permission.
17.\"
18.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28.\" SUCH DAMAGE.
29.\"
30.\"     From: @(#)send.2	8.2 (Berkeley) 2/21/94
31.\"
32.Dd August 1, 2018
33.Dt SCTP_GETADDRLEN 3
34.Os
35.Sh NAME
36.Nm sctp_getaddrlen
37.Nd return the address length of an address family
38.Sh LIBRARY
39.Lb libc
40.Sh SYNOPSIS
41.In sys/types.h
42.In sys/socket.h
43.In netinet/sctp.h
44.Ft int
45.Fn sctp_getaddrlen "sa_family_t family"
46.Sh DESCRIPTION
47The
48.Fn sctp_getaddrlen
49function returns the size of a specific address family.
50This function
51is provided for application binary compatibility since it
52provides the application with the size the operating system
53thinks the specific address family is.
54Note that the function
55will actually create an SCTP socket and then gather the
56information via a
57.Fn getsockopt
58system calls.
59If for some reason a SCTP socket cannot
60be created or the
61.Fn getsockopt
62call fails, an error will be returned
63with
64.Va errno
65set as specified in the
66.Fn socket
67or
68.Fn getsockopt
69system call.
70.Sh RETURN VALUES
71The call returns the number of bytes that the operating
72system expects for the specific address family or \-1.
73.Sh ERRORS
74The
75.Fn sctp_getaddrlen
76function can return the following errors:
77.Bl -tag -width Er
78.It Bq Er EINVAL
79The address family specified does NOT exist.
80.El
81.Sh SEE ALSO
82.Xr getsockopt 2 ,
83.Xr socket 2 ,
84.Xr sctp 4
85.Rs
86.%R RFC
87.%N 6458
88.%T "Sockets API Extensions for the Stream Control Transmission Protocol (SCTP)"
89.%D December 2011
90.Re
91.Sh HISTORY
92This function first appeared in
93.Nx 9.0 .
94