Provided by: manpages-zh_1.5.2-1_all bug

NAME

       send, sendto, sendmsg -

       #include <sys/types.h>
       #include <sys/socket.h>

       int send(int s, const void *msg, size_t len, int flags);
       int  sendto(int s, const void *msg, size_t len, int flags, const struct
       sockaddr *to, socklen_t tolen);
       int sendmsg(int s, const struct msghdr *msg, int flags);

       Send, sendto, sendmsg .  Send , sendto sendmsg .

        to , tolen .  len .  , EMSGSIZE ,.

        send.  ,-1.

       , send ,.  , EAGAIN .  The select(2) .

        flags ,:

       ,      MSG_OOB out-of-band ()(, SOCK_STREAM ); .   .

       MSG_DONTROUTE
              .  ..  ;.

       MSG_DONTWAIT
              ;, EAGAIN ( F_SETFL fcntl(2) O_NONBLOCK .)

       MSG_NOSIGNAL
               SIGPIPE , EPIPE .

       MSG_CONFIRM (Linux 2.3)
              :.  , (arp).  SOCK_DGRAM SOCK_RAW ,IPv4IPv6.  arp(7)

        msghdr .  recv(2) .

              struct msghdr {
                  void         * msg_name;     /**/
                  socklen_t    msg_namelen;    /**/
                  struct iovec * msg_iov;      /**/
                  size_t       msg_iovlen;     /*msg_iov*/
                  void         * msg_control;  /*,*/
                  socklen_t    msg_controllen; /**/
                  int          msg_flags;      /**/
              };

        msg_control msg_controllen .  net.core.optmem_max sysctl; socket(7).

       ,-1.

       .; man.

       EBADF  .

       ENOTSOCK
               s .

       EFAULT .

       EMSGSIZE
              .

       EAGAINEWOULDBLOCK
              ,.

       ENOBUFS
              ., (linux, .

       EINTR  .

       ENOMEM .

       EINVAL .

       EPIPE  .  SIGPIPE , MSG_NOSIGNAL

       4.4BSD,SVr4,POSIX1003.1g(4.2BSD).  MSG_CONFIRM Linux.

       Single        Unix         Specification,         glibc2;         flags
       BSD4.*`int',libc4libc5`unsigned                int';                len
       BSD4.*libc4`int',libc5'size_t';      tolen      BSD4.*,libc4libc5`int'.
       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)

[]

       byeyear <love_my_love@263.net >

[]

       2002.02.27

linuxman:

       http://cmpp.linuxforum.net