NAME | SYNOPSIS | DESCRIPTION | ATTRIBUTES | RETURN VALUES | ERRORS | SEE ALSO | NOTES
#include <tsix/t6attrs.h>ssize_t t6sendto(int sock, const char *msg, size_t len, int flags, const struct sockaddr *name, socklen_t namelen, const t6attr_t handle);
t6sendto() allows a privileged process to specify the security attributes to send with an IPC message. A process may specify only those attributes for which it possesses the appropriate override privilege and need not specify a full set. Any unspecified attributes are supplied by the kernel.
sock is a socket created with socket(3SOCKET). The address of the target is given by name with namelen specifying its size. The length of the message is given by len.
The name pointer and namelen parameter are used only if you are specifying the destination address; otherwise they should be set to 0. You may not specify the address if the trusted endpoint was created for a connection-oriented protocol, such as TCP. If the message is too long to pass atomically through the underlying protocol, then the message is not transmitted and the error EMSGSIZE is returned.
A return value of -1 indicates locally detected errors only, not implicitly that the message was not delivered.
The flags parameter is formed from the bitwise OR of zero or more of these values:
Send out-of-band data and any security attributes specified by a privileged process on sockets that support this notion provided that the underlying protocol also supports out-of-band data. Data and attributes sent with this flag are typically not subject to the internal buffering normally applied by the network to improve network efficiency.
The SO_DONTROUTE option is turned on for the duration of the operation. This option is used only by diagnostic or routing programs.
The security attributes are specified by the handle parameter. To set up handle, see t6set_attr(3NSL).
Only a process with the appropriate override privileges can specify the security attributes associated with the data it sends. To specify an attribute, a process must have the override privilege corresponding to the attribute. The override privilege required to specify an attribute is implementation
specific. For Trusted Solaris, one or more of these privileges may be required: PRIV_NET_DOWNGRADE_SL
, PRIV_NET_UPGRADE_SL
, PRIV_NET_SETCLR
, PRIV_NET_SETID
, PRIV_NET_SETPRIV
, PRIV_NET_BROADCAST
.
See attributes(5) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
---|---|
Availability | SUNWtsu |
MT-Level | MT-Safe |
Upon success, the return value is the number of bytes actually sent. Upon failure, the call returns -1 and sets the error code in errno.
Always checking the return value is critical, for the addition of security means that access to an endpoint may be revoked in response to a security violation.
t6sendto() fails if any of these conditions is true:
sock is an invalid file descriptor.
A destination address is not specified.
The operation was interrupted by delivery of a signal before any data could be buffered to be sent.
namelen is not the size of a valid address for the specified address family.
The socket requires that message be sent atomically, and the message was too long.
There was insufficient memory available to complete the operation.
There were insufficient STREAMS resources available for the operation to complete.
sock is not a socket.
libt6(3NSL), t6set_attr(3NSL), t6set_endpt_default(3NSL), socket(3SOCKET), Trusted Solaris Developer's Guide
This man page is based on the version from the TSIX(RE) 1.1 Application Programming Interface (API) document; and this interface is available in TSIX(RE) 1.1-API-compliant systems.
Only SOCK_STREAM sockets created in the AF_INET address family support out-of-band data.
NAME | SYNOPSIS | DESCRIPTION | ATTRIBUTES | RETURN VALUES | ERRORS | SEE ALSO | NOTES