* @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()
| 142 | * the actual allocation. It maintains the same behavior as _fdt_slot_alloc(). |
| 143 | */ |
| 144 | static 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. |
no test coverage detected