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

xtos_bci_session_create

Opens an XTOS BCI device with O_RDWR, creates a session, and attempts to cache GET_INFO.

On this page

Declaration

c
#include <xtos/bci.h>

xtos_bci_session_t *xtos_bci_session_create(const char *device_path);

Parameters

ParameterTypeDescription
device_pathconst char *Non-NULL NUL-terminated device-node path, for example /dev/xtos0.

Return value

Returns a session handle on success or NULL with allocation/open errno on failure. GET_INFO failure does not make an already opened session fail creation.

Errors

errnoCondition
EINVALdevice_path is NULL.
ENOENT/EACCES/EBUSYThe node is missing, permission is denied, or the driver disallows another opener.
system errnoPreserves errno from calloc or open failure.

Notes

  • The session owns the fd, device path, and mmap state; callers may borrow fd/mapping through the API but must not close/munmap them.
  • If GET_INFO fails, info remains calloc-zeroed and later get_info may still return 0; creation does not prove valid device UAPI support.
  • session.c provides no concurrency lock; do not concurrently read, configure, or destroy one session.

Example

Source

This reference describes headers and implementation at OpenXTOS commit dd313955ad57542bcd2af8827157d1bbd0cf5e83.