1.1.24.12 send

C

ssize_t send(int fd, const void *buf, size_t len, int flags)

Description

Send a message on a socket.

Parameters

ParametersDescription
fdSocket file descriptor.
bufPointer to buffer containing data to send.
lenLength of data to send.
flagsOption for transmission, currently ignored.

Returns

The number of bytes sent or -1 for error, see errno.

Remarks

errnoDescription
EBADFThe argument fd is not a valid file descriptor.
EFAULTSystem fault.
ENOTSOCKThe file descriptor fd does not refer to a socket.
EWOULDBLOCKThe socket is marked nonblocking and the send operation would block.
ENOMEMInsufficient memory is available.
EDESTADDRREQThe socket is not connection-mode, and no peer address is set.
ENOTCONNThe socket is not connected, and no target has been given.