| ![[Previous]](../prev.gif) | ![[Contents]](../contents.gif) | ![[Index]](../keyword_index.gif) | ![[Next]](../next.gif) | 
Allow for the configuration of a module by an external source
static int devctrl( inout_module_t *pModule, 
                    int event, 
                    void *ptr );
This function lets an external source — typically another module — configure a module. It's invoked by an output module at arbitrary points of execution.
The pModule parameter holds a pointer to a module descriptor.
What this function should do depends on which layer it's in:
If event isn't meaningful, return -1 and set errno to EINVAL.
If event isn't meaningful and there's a linked input module, invoke the input module's devctrl() callback.
|  | To add a new DEVCTL command, make an entry in include/const.h and define any data sent with the DEVCTL in struct.h. | 
EOK
Your code
| Safety: | |
|---|---|
| Interrupt handler | Yes | 
| Signal handler | Yes | 
| Thread | Yes | 
| ![[Previous]](../prev.gif) | ![[Contents]](../contents.gif) | ![[Index]](../keyword_index.gif) | ![[Next]](../next.gif) |