NAME
t6sendto - specify security attributes to send with data on a trusted endpoint
cc [ flag ... ] file ... -lt6 [ library ... ]
#include <tsix/t6attrs.h>
int t6sendto(int fd, const char *msg, int len, int flags, const struct
sockaddr *to, int tolen, const t6attr_t attr_ptr)
DESCRIPTION
t6sendto allows a privileged process to specify the security attributes
to send with an IPC message. A process may only specify 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.
fd is a socket created with socket(3N) . The address of the target is given by to with tolen specifying its size. The length of the message is given by len .
The to pointer and to_len parameters are only used 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 error is returned, and the message is not transmitted.
A return value of -1 indicates locally detected errors only. It does not implicitly mean the message was not delivered.
The flags parameter is formed from the bitwise OR of zero or more of the following:
Send out-of-band data and any security attributes specified by a privileged process on sockets that support this notion. The underlying protocol must also support 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.
RETURN VALUE
The return value is the number of bytes actually sent, or -1 indicating
an error, with the error code stored in errno . It is critical that
the return value always be checked, for the addition of security means
that access to an endpoint may be revoked in response to a security violation.
PRIVILEGES
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.
Errors generated by t6sendto are indicated by the global variable errno The calls fail if:
There was insufficient memory available to complete the operation.
There were insufficient
STREAMS resources available for the operation to complete.