XTOS / OPEN SOURCE REAL-TIME SYSTEMOPEN SOURCE · 1.0.2 · PRERELEASE · IMAGES & 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 in OpenXTOS v1.0.2 (c24e923717670c4724cdaf24c7c105caee8dc2fb).