Content-type: text/html
Manpage of TCBsendto
TCBsendto
Section: Timely Computing Base (1)
Updated: 30 September 2002
Index
Return to Main Contents
NAME
TCBsendto - sends a message from a TCB socket
SYNOPSIS
#include
"tcb/tcb.h"
int TCBsendto(void* buff, int nbytes, unsigned int flags, struct sockaddr *to, int addrlen, TCBsocketDesc* desc, TCBtimestamp send_evt);
DESCRIPTION
TCBsendto
is used to transmit a message to another socket.
The address of the target is given by
to
with
addrlen
specifying its size. The length of the message is given by
nbytes.
If the message is too long to pass atomically through the
underlying protocol, the error
EMSGSIZE
is returned, and the message is not transmitted.
No indication of failure to deliver is implicit in a
TCBsendto.
Locally detected errors are indicated by a return value of -1.
When the message does not fit into the send buffer of the socket,
TCBsendto
normally blocks, unless the socket has been placed in non-blocking I/O
mode. In non-blocking mode it would return
EAGAIN
in this case.
The
select(2)
call may be used to determine when it is possible to send more data.
The parameter
desc
is the descriptor of the TCB socket.
send_evt
is the timestamp that signals the start of the interval that will be measured.
The
flags
parameter is a flagword and can contain the following flags:
- 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_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.
RETURN VALUES
The calls return the number of characters sent, or -1
if an error occurred.
ERRORS
These are some standard errors generated by the socket layer. Additional errors
may be generated and returned from the underlying protocol modules; see their
respective manual pages.
- EBADF
-
An invalid descriptor was specified.
- ENOTSOCK
-
The argument
s
is not a socket.
- EFAULT
-
An invalid user space address was specified for a parameter.
- EMSGSIZE
-
The socket requires that message be sent atomically, and the size
of the message to be sent made this impossible.
- EAGAIN or EWOULDBLOCK
-
The socket is marked non-blocking and the requested operation
would block.
- ENOBUFS
-
The output queue for a network interface was full.
This generally indicates that the interface has stopped sending,
but may be caused by transient congestion.
(This cannot occur in Linux, packets are just silently dropped
when a device queue overflows.)
- EINTR
-
A signal occurred.
- ENOMEM
-
No memory available.
- 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.
SEE ALSO
sendto (2), TCBsocket, TCBbind (1), TCBwinfoport (1), TCBrecvfrom (1), TCBsocketClose (1)
Index
- NAME
-
- SYNOPSIS
-
- DESCRIPTION
-
- RETURN VALUES
-
- ERRORS
-
- SEE ALSO
-
This document was created by
man2html,
using the manual pages.
Time: 23:05:27 GMT, August 06, 2003