1.1.24.13 sendto
C
ssize_t sendto(int fd, const void *buf, size_t len, int flags, const struct sockaddr *addr, socklen_t alen)Description
Send a message on a socket.
Parameters
| Parameters | Description |
|---|---|
| fd | Socket file descriptor. |
| buf | Pointer to buffer containing data to send. |
| len | Length of data to send. |
| flags | Option for transmission, currently ignored. |
| addr | Pointer to address structure. |
| alen | Length of address structure. |
Returns
The number of bytes sent or -1 for error, see errno.
Remarks
| errno | Description |
|---|---|
| EBADF | The argument fd is not a valid file descriptor. |
| EFAULT | System fault. |
| ENOTSOCK | The file descriptor fd does not refer to a socket. |
| EWOULDBLOCK | The socket is marked nonblocking and the send operation would block. |
| ENOMEM | Insufficient memory is available. |
| EMSGSIZE | The argument data is too long to pass atomically through the underlying protocol |
| EDESTADDRREQ | The socket is not connection-mode, and no peer address is set. |
| ENOTCONN | The socket is not connected, and no target has been given. |
