X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/2d21ac55c334faf3a56e5634905ed6987fc787d4..0a7de7458d150b5d4dffc935ba399be265ef0a1a:/bsd/man/man2/send.2?ds=sidebyside diff --git a/bsd/man/man2/send.2 b/bsd/man/man2/send.2 index 9b6346372..acadd27b2 100644 --- a/bsd/man/man2/send.2 +++ b/bsd/man/man2/send.2 @@ -53,7 +53,7 @@ .Ft ssize_t .Fo sendmsg .Fa "int socket" -.Fa "const struct msghdr *buffer" +.Fa "const struct msghdr *message" .Fa "int flags" .Fc .Ft ssize_t @@ -66,12 +66,12 @@ .Fa "socklen_t dest_len" .Fc .Sh DESCRIPTION -.Fn Send , +.Fn send , .Fn sendto , and .Fn sendmsg are used to transmit a message to another socket. -.Fn Send +.Fn send may be used only when the socket is in a .Em connected state, while @@ -127,9 +127,33 @@ data. .Dv MSG_DONTROUTE is usually used only by diagnostic or routing programs. .Pp +The +.Fn sendmsg +system call uses a +.Fa msghdr +structure to minimize the number of directly supplied arguments. +The +.Fa msg_iov +and +.Fa msg_iovlen +fields of message specify zero or more buffers +containing the data to be sent. +.Fa msg_iov +points to an array of iovec structures; +.Fa msg_iovlen +shall be set to the dimension of this array. +In each iovec structure, the +.Fa iov_base +field specifies a storage area and +the +.Fa iov_len +field gives its size in bytes. Some of these sizes can be zero. +The data from each storage area indicated by +.Fa msg_iov +is sent in turn. See .Xr recv 2 -for a description of the +for a complete description of the .Fa msghdr structure. .Sh RETURN VALUES @@ -174,6 +198,7 @@ before any data is transmitted. .It Bq Er EMSGSIZE The socket requires that message be sent atomically, and the size of the message to be sent makes this impossible. +.Dv IOV_MAX . .\" =========== .It Bq Er ENETDOWN The local network interface used to reach the destination is down. @@ -205,6 +230,9 @@ The socket is shut down for writing or the socket is connection-mode and is no longer connected. In the latter case, and if the socket is of type SOCK_STREAM, the SIGPIPE signal is generated to the calling thread. +.\" ========== +.It Bq Er EADDRNOTAVAIL +The specified address is not available or no longer available on this machine. .El .Pp The @@ -259,6 +287,13 @@ system call will fail if: .\" =========== .It Bq Er EINVAL The sum of the iov_len values overflows an ssize_t. +.\" =========== +.It Bq Er EMSGSIZE +The socket requires that message be sent atomically, +and the size of the message to be sent makes this impossible, +or the msg_iovlen member of the msghdr structure pointed to by message +is less than or equal to 0 or is greater than +.Dv IOV_MAX . .El .Sh LEGACY SYNOPSIS .Fd #include