xtos_ bci_ get_ fd
Returns the session-owned device file descriptor for use with poll/select and similar APIs.
On this page
Declaration
#include <xtos/bci.h>
int xtos_bci_get_fd(xtos_bci_session_t *session);Parameters
| Parameter | Type | Description |
|---|---|---|
| session | xtos_bci_session_t * | Non-NULL session handle; the returned fd is borrowed. |
Return value
Returns a nonnegative fd on success and -1 on failure.
Errors
| errno | Condition |
|---|---|
| EINVAL | session is NULL. |
Notes
- The caller must not close this fd; it becomes invalid after session destruction.
- create uses O_RDWR without O_NONBLOCK; a read after poll can still short-read, be interrupted, or block.
- The function allocates no memory, does not duplicate the fd, and provides no thread synchronization.
Example
Source
This reference describes headers and implementation at OpenXTOS commit dd313955ad57542bcd2af8827157d1bbd0cf5e83.