XTOS / OPEN SOURCE REAL-TIME SYSTEMOPEN SOURCE · VERSION 0.9.0 · BUILD FROM SOURCE
libxtos-bcixtos_bci_get_fd

xtos_bci_get_fd

Returns the session-owned device file descriptor for use with poll/select and similar APIs.

On this page

Declaration

c
#include <xtos/bci.h>

int xtos_bci_get_fd(xtos_bci_session_t *session);

Parameters

ParameterTypeDescription
sessionxtos_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

errnoCondition
EINVALsession 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.