Skip to main content


io_wrapper_open — Open a handle to a resource


#include "io_wrapper.h"

| io_object * **io_wrapper_open** ( | filename, |   | |   | options, |   | |   | mode); |   |

const char * <var class="pdparam">filename</var>; int <var class="pdparam">options</var>; int <var class="pdparam">mode</var>;


Open a handle to a resource.


This function may induce IO or otherwise block the caller. Blocking in the scheduler thread will lead to degraded performance and should be avoided at all costs. If your code is running in the IO subsystem, the core will have already taken steps to ensure that blocking is acceptable. Otherwise, you should look at using the thread pool API to run a job in the IO pool.

You must use io_wrapper_delref to dispose of any object opened using this function. The object won't be destroyed until its last reference is dropped.



The name of the resource.


Options can be any bitwise OR of the flags used with open(3), for example O_RDWR, O_CREAT etc.


The file mode in octal notation.

Return Values

This function returns a handle to the resource.


It is legal to call this function in any thread.

See Also

Was this page helpful?