Differences between version 3 and previous revision of send(2).
Other diffs: Previous Major Revision, Previous Author, or view the Annotated Edit History
Newer page: | version 3 | Last edited on Tuesday, November 18, 2003 11:53:13 am | by JohnMcPherson | Revert |
Older page: | version 2 | Last edited on Saturday, July 5, 2003 2:05:24 am | by PerryLorier | Revert |
@@ -4,8 +4,9 @@
__#include <sys/types.h>__
__#include <sys/socket.h>__
__int send(int__ ''s''__, const void *__''msg''__, size_t__ ''len''__, int__ ''flags''__);__
+
!!DESCRIPTION
send(2) is used to transmit a message to another socket. send(2) may be used only when the socket is in a ''connected'' state.
The address of the target is given by ''to'' with ''tolen'' specifying its size. The length of the message is given by ''len''. If the message is too long to pass atomically through the underlying protocol, the error [EMSGSIZE] is returned, and the message is not transmitted.
@@ -18,11 +19,11 @@
;__MSG_OOB__: Sends ''out-of-band'' data on sockets that support this notion (e.g. __SOCK_STREAM__); the underlying protocol must also support ''out-of-band'' data.
;__MSG_DONTROUTE__: Dont't use a gateway to send out the packet, only send to hosts on directly connected networks. This is usually used only by diagnostic or routing programs. This is only defined for protocol families that route; packet sockets don't.
-;__MSG_DONTWAIT__: Enables non-blocking operation; if the operation would block, __EAGAIN__ is returned (this can also be enabled using the __O_NONBLOCK__ with the __F_SETFL__
__fcntl(2)).__
+;__MSG_DONTWAIT__: Enables non-blocking operation; if the operation would block, __EAGAIN__ is returned (this can also be enabled using the __O_NONBLOCK__ with the __F_SETFL__ fcntl(2)).
-;__
MSG_NOSIGNAL__
: Requests not to send [SIGPIPE] on errors on stream oriented sockets when the other end breaks the connection. The [EPIPE] error is still returned.
+;[
MSG_NOSIGNAL]
: Requests not to send [SIGPIPE] on errors on stream oriented sockets when the other end breaks the connection. The [EPIPE] error is still returned.
;__MSG_CONFIRM__: (Linux 2.3+ only) Tell the link layer that forward process happened: you got a successful reply from the other side. If the link layer
doesn't get this it'll regularly reprobe the neighbour (e.g. via a unicast ARP). Only valid on __SOCK_DGRAM__ and __SOCK_RAW__ sockets and currently only implemented for [IPv4] and [IPv6]. See arp(7) for details.
@@ -58,13 +59,13 @@
;[EINVAL]: Invalid argument passed.
;[EPIPE]: The local end has been shut down on a connection oriented socket. In this case the process will also receive a [SIGPIPE] unless __MSG_NOSIGNAL__ is set.
!!CONFORMING TO
-4.4BSD, SVr4, POSIX 1003.1g draft (these function calls appeared in 4.2BSD).
+4.4BSD, SVr4, [
POSIX]
1003.1g draft (these function calls appeared in 4.2BSD).
__MSG_CONFIRM__ is a Linux extension.
!!NOTE
-The prototypes given above follow the Single Unix Specification, as glibc2 also does; the ''flags'' argument was `int' in BSD 4.*, but `unsigned int' in libc4 and libc5; the ''len'' argument was `int' in BSD 4.* and libc4, but `size_t' in libc5; the ''tolen'' argument was `int' in BSD 4.* and libc4 and libc5. See also accept(2).
+The prototypes given above follow the Single Unix Specification, as glibc2 also does; the ''flags'' argument was `int' in [
BSD]
4.*, but `unsigned int' in libc4 and libc5; the ''len'' argument was `int' in BSD 4.* and libc4, but `size_t' in libc5; the ''tolen'' argument was `int' in BSD 4.* and libc4 and libc5. See also accept(2).
!!SEE ALSO
fcntl(2), recv(2), select(2), getsockopt(2), sendfile(2), socket(2), write(2), socket(7), ip(7), tcp(7), udp(7)