MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / _fdt_fd_alloc

Function _fdt_fd_alloc

components/dfs/dfs_v2/src/dfs.c:144–151  ·  view source on GitHub ↗

* @brief Allocate a file descriptor from the file descriptor table * * @param[in,out] fdt Pointer to the file descriptor table to allocate from * @param[in] startfd The starting file descriptor index to begin searching * * @return int The allocated file descriptor index if successful (>= 0), * -1 if allocation failed * * @note This is a wrapper function that calls _fdt_slot_alloc()

Source from the content-addressed store, hash-verified

142 * the actual allocation. It maintains the same behavior as _fdt_slot_alloc().
143 */
144static int _fdt_fd_alloc(struct dfs_fdtable *fdt, int startfd)
145{
146 int idx;
147
148 idx = _fdt_slot_alloc(fdt, startfd);
149
150 return idx;
151}
152
153/**
154 * this function will lock device file system.

Callers 1

fdt_fd_newFunction · 0.85

Calls 1

_fdt_slot_allocFunction · 0.85

Tested by

no test coverage detected