riot_sys

Function vfs_bind

Source
pub unsafe extern "C" fn vfs_bind(
    fd: c_int,
    flags: c_int,
    f_op: *const vfs_file_ops_t,
    private_data: *mut c_void,
) -> c_int
Expand description

@brief Allocate a new file descriptor and give it file operations

The new fd will be initialized with pointers to the given @p f_op file operations table and @p private_data.

This function can be used to give file-like functionality to devices, e.g. UART.

@p private_data can be used for passing instance information to the file operation handlers in @p f_op.

@param[in] fd Desired fd number, use VFS_ANY_FD for any available fd @param[in] flags not implemented yet @param[in] f_op pointer to file operations table @param[in] private_data opaque pointer to private data

@return fd number on success (>= 0) @return <0 on error