⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sendmsg.3.man

📁 This a separate release of the OpenSS7 X/Open XTI/TLI library, TLI modules (timod, tirdwr) and the I
💻 MAN
字号:
'\" rtp.\" -*- nroff -*- vim: ft=nroff noautoindent nocindent nosmartindent.\".\" @(#) sendmsg.3.man,v 1.1.2.1 2004/05/16 02:35:35 brian Exp.\".\" =========================================================================.\".\" Copyright (C) 2001-2004  OpenSS7 Corporation <www.openss7.com>.\".\" All Rights Reserved..\".\" Permission is granted to make and distribute verbatim copies of this.\" manual provided the copyright notice and this permission notice are.\" preserved on all copies..\".\" Permission is granted to copy and distribute modified versions of this.\" manual under the conditions for verbatim copying, provided that the.\" entire resulting derived work is distributed under the terms of a.\" permission notice identical to this one.\" .\" Since the Linux kernel and libraries are constantly changing, this.\" manual page may be incorrect or out-of-date.  The author(s) assume no.\" responsibility for errors or omissions, or for damages resulting from.\" the use of the information contained herein.  The author(s) may not.\" have taken the same level of care in the production of this manual,.\" which is licensed free of charge, as they might when working.\" professionally..\" .\" Formatted or processed versions of this manual, if unaccompanied by.\" the source, must acknowledge the copyright and authors of this work..\".\" -------------------------------------------------------------------------.\".\" U.S. GOVERNMENT RESTRICTED RIGHTS.  If you are licensing this Software.\" on behalf of the U.S. Government ("Government"), the following.\" provisions apply to you.  If the Software is supplied by the Department.\" of Defense ("DoD"), it is classified as "Commercial Computer Software".\" under paragraph 252.227-7014 of the DoD Supplement to the Federal.\" Acquisition Regulations ("DFARS") (or any successor regulations) and the.\" Government is acquiring only the license rights granted herein (the.\" license rights customarily provided to non-Government users).  If the.\" Software is supplied to any unit or agency of the Government other than.\" DoD, it is classified as "Restricted Computer Software" and the.\" Government's rights in the Software are defined in paragraph 52.227-19.\" of the Federal Acquisition Regulations ("FAR") (or any success.\" regulations) or, in the cases of NASA, in paragraph 18.52.227-86 of the.\" NASA Supplement to the FAR (or any successor regulations)..\".\" =========================================================================.\" .\" Commercial licensing and support of this software is available from.\" OpenSS7 Corporation at a fee.  See http://www.openss7.com/.\" .\" =========================================================================.\".\" Last Modified 2004/05/16 02:35:35 by brian.\".\" =========================================================================.so strxnet.macros.R1bracket-label "\fR[\fB" "\fR]" "\fR, \fB"no-default-databasedatabase strxnet.refsaccumulatemove-punctuationabbreviate Ajoin-authors ", " ", " " and "et-al " et al" 2 3abbreviate-label-ranges ".."sort-adjacent-labels.R2.\".\".\".\".TH SENDMSG 3 "2004/05/16 02:35:35" "strxnet-0_9_2-4" "Linux Fast-STREAMS Sockets Library".SH NAME.B sendmsg\- send a message on a socket using a message structure.SH SYNOPSIS.PP.B #include <sys/socket.h>.HP.BI "ssize_t sendmsg(int " socket ", const struct msghdr *" message ", int " flags );.SH DESCRIPTION.PPThe.BR sendmsg ()function sends a message through a connection-mode orconnectionless-mode socket.  If the socket is connectionless-mode, the messagewill be sent to the address specified by.BR msghdr .If the socket isconnection-mode, the destination address in.B msghdris ignored..PPThe function takes the following arguments:.TP.I socketSpecifies the socket file descriptor..TP.I messagePoints to a.B msghdrstructure, containing both the destination address and thebuffers for the outgoing message.  The length and format of the address dependon the address family of the socket.  The.I msg_flagsmember is ignored..TP.I flagsSpecifies the type of message transmission.  The application may specify 0 orthe following flag:.RS.TP.B MSG_EORTerminates a record (if supported by the protocol).TP.B MSG_OOBSends out-of-band data on sockets that support out-of-bound data.  Thesignificance and semantics of out-of-band data are protocol-specific..RE.PPThe.I msg_iovand.I msg_iovlenfields of message specify zero or more bufferscontaining the data to be sent..I msg_iovpoints to an array of iovecstructures;.I msg_iovlenmust be set to the dimension of this array.  In eachiovec structure, the.I iov_basefield specifies a storage area and the.I iov_lenfield gives its size in bytes.  Some of these sizes can be zero.  The data fromeach storage area indicated by.I msg_iovis sent in turn..PPSuccessful completion of a call to.BR sendmsg ()does not guarantee delivery ofthe message.  A return value of -1 indicates only locally-detected errors..PPIf space is not available at the sending socket to hold the message to betransmitted and the socket file descriptor does not have.B O_NONBLOCKset,.BR sendmsg ()function blocks until space is available.  If space is not availableat the sending socket to hold the message to be transmitted and the socketfile descriptor does have.B O_NONBLOCKset,.BR sendmsg ()function will fail..PPIf the socket protocol supports broadcast and the specified address is abroadcast address for the socket protocol,.BR sendmsg ()will fail if the.B SO_BROADCASToption is not set for the socket..PPThe socket in use may require the process to have appropriate privileges touse the.BR sendmsg ()function..SH NOTES.PPThe.BR select (2)and.BR poll (2)functions can be used to determine when it ispossible to send more data..SH CAVEATS.PPThis system call is implemented as a.B SIOCSOCKSYSIOCTL.  See.BR socksys (4)for more information..SH "RETURN VALUE".PPUpon successful completion,.BR sendmsg ()function returns the number of bytessent.  Otherwise, -1 is returned and errno is set to indicate the error..SH ERRORS.PPThe.BR sendmsg ()function will fail if:.TP.RB [ EAGAIN "] or [" EWOULDBLOCK ]The socket's file descriptor is marked.B O_NONBLOCKand the requested operationwould block..TP.RB [ EAFNOSUPPORT ]Addresses in the specified address family cannot be used withthis socket..TP.RB [ EBADF ]The socket argument is not a valid file descriptor..TP.RB [ ECONNRESET ]A connection was forcibly closed by a peer..TP.RB [ EFAULT ]The message parameter, or storage pointed to by the.IR msg_name ,.I msg_controlor.I msg_iovfields of the message parameter, orstorage pointed to by the iovec structures pointed to by the.I msg_iovfield can not be accessed..TP.RB [ EINTR ]A signal interrupted.BR sendmsg ()before any data was transmitted..TP.RB [ EINVAL ]The sum of the.I iov_lenvalues overflows an.BR ssize_t ..TP.RB [ EMSGSIZE ]The message is too large to be sent all at once (as the socketrequires), or the.I msg_iovlenmember of the.B msghdrstructurepointed to by message is less than or equal to 0 or is greaterthan {IOV_MAX}..TP.RB [ ENOTCONN ]The socket is connection-mode but is not connected..TP.RB [ ENOTSOCK ]The socket argument does not refer a socket..TP.RB [ EOPNOTSUPP ]The socket argument is associated with a socket that does notsupport one or more of the values set in.IR flags ..TP.RB [ EPIPE ]The socket is shut down for writing, or the socket isconnection-mode and is no longer connected.  In the latter case,and if the socket is of type.BR SOCK_STREAM ,the.B SIGPIPEsignal isgenerated to the calling process..PPIf the address family of the socket is.BR AF_UNIX ,then.BR sendmsg ()willfail if:.TP.RB [ EIO ]An I/O error occurred while reading from or writing to the filesystem..TP.RB [ ELOOP ]Too many symbolic links were encountered in translating thepathname in the socket address..TP.RB [ ENAMETOOLONG ]A component of a pathname exceeded.RI { NAME_MAX }characters, or anentire pathname exceeded.RI { PATH_MAX }characters..TP.RB [ ENOENT ]A component of the pathname does not name an existing file orthe pathname is an empty string..TP.RB [ ENOTDIR ]A component of the path prefix of the pathname in the socketaddress is not a directory..PPThe.BR sendmsg ()function may fail if:.TP.RB [ EACCES ]Search permission is denied for a component of the path prefix;or write access to the named socket is denied..TP.RB [ EDESTADDRREQ ]The socket is not connection-mode and does not have its peeraddress set, and no destination address was specified..TP.RB [ EHOSTUNREACH ]The destination host cannot be reached (probably because thehost is down or a remote router cannot reach it)..TP.RB [ EIO ]An I/O error occurred while reading from or writing to the filesystem..TP.RB [ EISCONN ]A destination address was specified and the socket is alreadyconnected..TP.RB [ ENETDOWN ]The local interface used to reach the destination is down..TP.RB [ ENETUNREACH ]No route to the network is present..TP.RB [ ENOBUFS ]Insufficient resources were available in the system to performthe operation..TP.RB [ ENOMEM ]Insufficient memory was available to fulfill the request..TP.RB [ ENOSR ]There were insufficient.IR STREAMS (4)resources available for theoperation to complete..PPIf the address family of the socket is.BR AF_UNIX ,then.BR sendmsg ()mayfail if:.TP.RB [ ENAMETOOLONG ]Pathname resolution of a symbolic link produced an intermediateresult whose length exceeds.RI { PATH_MAX }..SH "SEE ALSO".PP.BR getsockopt (3),.BR poll (2),.BR recv (3),.BR recvfrom (3),.BR recvmsg (3),.BR select (2),.BR send (3),.BR sendto (3),.BR setsockopt (3),.BR shutdown (3),.BR socket (3),.BR <sys/socket.h> (5)..SH "CONFORMING TO".PPThe Open Group XNS Issue 5.2..[xns.].\".\".[$LIST$.].TI

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -