blob: 7854aec0ff8ef93225c72f2fa4f998d6cc8b94b4 [file] [log] [blame]
Austin Schuh8d0a2852019-12-28 22:54:28 -08001.\" (C) Copyright Sridhar Samudrala IBM Corp. 2004, 2005.
2.\"
3.\" Permission is granted to distribute possibly modified copies
4.\" of this manual provided the header is included verbatim,
5.\" and in case of nontrivial modification author and date
6.\" of the modification is added to the header.
7.\"
8.TH SCTP_RECVMSG 3 2005-10-25 "Linux 2.6" "Linux Programmer's Manual"
9.SH NAME
10sctp_recvmsg \- Receive a message from a SCTP socket.
11.SH SYNOPSIS
12.nf
13.B #include <sys/types.h>
14.B #include <sys/socket.h>
15.B #include <netinet/sctp.h>
16.sp
17.BI "int sctp_recvmsg(int " sd ", void * " msg ", size_t " len ,
18.BI " struct sockaddr * " from ", socklen_t * " fromlen ,
19.BI " struct sctp_sndrcvinfo * " sinfo ", int * " msg_flags);
20.fi
21.SH DESCRIPTION
22.BR sctp_recvmsg
23is a wrapper library function that can be used to receive a message from
24a socket while using the advanced features of SCTP.
25.I sd
26is the socket descriptor on which the message pointed to by
27.I msg
28of length
29.I len
30is received.
31.PP
32If
33.I from
34is not NULL, the source address of the message is filled in. The argument
35.I fromlen
36is a value-result parameter. initialized to the size of the buffer associated
37with
38.I from ,
39and modified on return to indicate the actual size of the address stored.
40.PP
41.I sinfo
42is a pointer to a sctp_sndrcvinfo structure to be filled upon receipt of the
43message.
44.I msg_flags
45is a pointer to a integer that is filled with any message flags like
46.B MSG_NOTIFICATION or
47.B MSG_EOR.
48The value of
49.I msg_flags
50pointer should be initialized to 0 to avoid unexpected behavior;
51.I msg_flags
52is also used as an input
53.I flags
54argument to
55.I recvmsg
56function.
57.SH "RETURN VALUE"
58On success,
59.BR sctp_recvmsg
60returns the number of bytes received or -1 if an error occurred.
61.SH "SEE ALSO"
62.BR sctp (7)
63.BR sctp_bindx (3),
64.BR sctp_connectx (3),
65.BR sctp_sendmsg (3),
66.BR sctp_sendv (3),
67.BR sctp_send (3),
68.BR sctp_peeloff (3),
69.BR sctp_getpaddrs (3),
70.BR sctp_getladdrs (3),
71.BR sctp_opt_info (3)