_IO_INPUT_PAYLOAD()
Generate a pointer to the payload that follows the header represented by the i member of an I/O message object
Synopsis:
#include <sys/iomsg.h>
void* _IO_INPUT_PAYLOAD(msg);
Arguments:
- msg
- A pointer to an I/O message object that defines an i member.
Library:
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
Description:
The _IO_INPUT_PAYLOAD() macro generates a pointer to the variable-length payload that follows the header represented by the i member of the given I/O message object.
When msg is a pointer to an object of type io_devctl_t, _IO_INPUT_PAYLOAD() and _IO_OUTPUT_PAYLOAD() are guaranteed to return the same pointer value.
When writing message handler functions for resource managers, the _IO_*_PAYLOAD() macros should be used to obtain a pointer to the message payload. This reduces the likelihood of a false positive buffer overflow failure when compiling with the _FORTIFY_SOURCE feature enabled at a level greater than 1. The _IO_*_PAYLOAD() macros are implemented using the more general-purpose _PAYLOAD_OF() macro.
For _IO_DEVCTL message handlers, _IO_INPUT_PAYLOAD(msg) and _IO_OUTPUT_PAYLOAD(msg) should be used instead of _DEVCTL_DATA(msg->i) and _DEVCTL_DATA(msg->o).
Returns:
A pointer to the variable-length payload that follows the i member of msg.
Classification:
Safety: | |
---|---|
Cancellation point | Yes |
Signal handler | Yes |
Thread | Yes |