iofunc_check_msg_default()
Check a message
Synopsis:
#include <sys/iofunc.h>
int iofunc_check_msg_default(resmgr_context_t const *ctp,
                             resmgr_iomsgs_t const *msg, 
                             bool combine,
                             iofunc_ocb_t const *ocb);
Arguments:
- ctp
 - A pointer to a resmgr_context_t structure that the resource-manager library uses to pass context information between functions.
 - msg
 - A pointer to the current message.
 - combine
 - True if the message buffer has further messages following this one; otherwise, false.
 - ocb
 - A pointer to the iofunc_ocb_t structure for the Open Control Block that was created when the client opened the resource.
 
Library:
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
Description:
The iofunc_check_msg_default() function is the default handler for check_msg.
When a client sends a message or a group of messages to a resmgr, the resmgr framework must call the appropriate handler function for each message in sequence. However, before calling this handler, it calls the check_msg entry in the io_funcs structure to perform additional validation. Anything other than EOK returns as an error for that message and the message handler is not called.
If check_msg is NULL, the io_funcs structure calls the default handler, iofunc_check_msg_default().
The iofunc_check_msg_default() function returns an error when encountering an _IO_DEVCTL or _IO_MSG message that is followed by further messages as part of a combine message. This is to avoid a potential security vulnerability in the case where either an _IO_DEVCTL or _IO_MSG message includes a sigevent.
Returns:
- EOK
 - The message is OK.
 - EBADMSG
 - The message should be denied.
 
Classification:
| Safety: | |
|---|---|
| Cancellation point | No | 
| Signal handler | Yes | 
| Thread | Yes | 
