OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [ecos-2.0/] [packages/] [net/] [tcpip/] [v2_0/] [doc/] [sendto.html] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1254 phoenix
<html>
2
<body>
3
<pre>
4
NAME
5
       sendto - send a message from a socket
6
 
7
SYNOPSIS
8
       #include &lt;network.h&gt;
9
 
10
       int sendto(int s, const void *msg, int len,  unsigned  int
11
       flags, const struct sockaddr *to, int tolen);
12
 
13
DESCRIPTION
14
       Sendto is used to transmit  a  message
15
       to  another socket.
16
 
17
       The address of the target is given by to with tolen speci­
18
       fying its size.  The length of the  message  is  given  by
19
       len.   If  the  message  is  too  long  to pass atomically
20
       through the underlying protocol,  the  error  EMSGSIZE  is
21
       returned, and the message is not transmitted.
22
 
23
       No indication of failure to deliver is implicit in a send.
24
       Locally detected errors are indicated by a return value of
25
       -1.
26
 
27
       When  the message does not fit into the send buffer of the
28
       socket, send normally blocks, unless the socket  has  been
29
       placed  in non-blocking I/O mode.  In non-blocking mode it
30
       would return EAGAIN in this case.  The select(2) call  may
31
       be  used  to  determine  when  it is possible to send more
32
       data.
33
 
34
       The flags parameter may include one or more of the follow­
35
       ing:
36
 
37
              #define MSG_OOB           0x1     /* process out-of-band data */
38
              #define MSG_DONTROUTE     0x4     /* bypass routing, use direct interface */
39
              #define MSG_DONTWAIT      0x40    /* don't block */
40
              #define MSG_NOSIGNAL      0x2000  /* don't raise SIGPIPE */
41
 
42
       MSG_OOB
43
              Sends out-of-band data on sockets that support this
44
              notion (e.g.  SOCK_STREAM); the underlying protocol
45
              must also support out-of-band data.
46
 
47
       MSG_DONTROUTE
48
              Bypasses  the  usual routing table lookup and sends
49
              the packet directly to the interface  described  by
50
              the  destination address. This is usually used only
51
              by diagnostic or routing programs.
52
 
53
       MSG_DONTWAIT
54
              Enables non-blocking operation;  if  the  operation
55
              would block, EAGAIN is returned.
56
 
57
       MSG_NOSIGNAL
58
              Requests  not  to  send SIGPIPE on errors on stream
59
              oriented sockets when the other end breaks the con­
60
              nection. The EPIPE error is still returned.
61
 
62
       See recv(2) for a description of the msghdr structure. You
63
       may send control information  using  the  msg_control  and
64
       msg_controllen  members. The maximum control buffer length
65
       the kernel can process is  limited  by  the  net.core.opt­
66
       mem_max sysctl; see socket(4).
67
 
68
RETURN VALUES
69
       The  calls  return the number of characters sent, or -1 if
70
       an error occurred.
71
 
72
ERRORS
73
       These are some standard errors  generated  by  the  socket
74
       layer.  Additional  errors  may  be generated and returned
75
       from the underlying protocol modules; see their respective
76
       manual pages.
77
 
78
       EBADF   An invalid descriptor was specified.
79
 
80
       ENOTSOCK
81
               The argument s is not a socket.
82
 
83
       EMSGSIZE
84
               The socket requires that message  be  sent  atomi­
85
               cally, and the size of the message to be sent made
86
               this impossible.
87
 
88
       EAGAIN  The  socket  is  marked   non-blocking   and   the
89
               requested operation would block.
90
 
91
       ENOBUFS The system was unable to allocate an internal mem­
92
               ory block.  The operation may succeed when buffers
93
               become available.
94
 
95
       EINTR   A signal occurred.
96
 
97
       ENOMEM  No memory available.
98
 
99
       EINVAL  Invalid argument passed.
100
 
101
       EPIPE   The  local  end has been shut down on a connection
102
               oriented socket.  In this case  the  process  will
103
               also receive a SIGPIPE unless MSG_NOSIGNAL is set.
104
</pre>
105
</body>
106
</html>

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.