* @brief Allocate a new file descriptor in current process's file descriptor table * * @return int The allocated file descriptor index if successful (>= 0), * -1 if allocation failed */
| 455 | * -1 if allocation failed |
| 456 | */ |
| 457 | int fd_new(void) |
| 458 | { |
| 459 | struct dfs_fdtable *fdt; |
| 460 | |
| 461 | fdt = dfs_fdtable_get(); |
| 462 | |
| 463 | return fdt_fd_new(fdt); |
| 464 | } |
| 465 | |
| 466 | /** |
| 467 | * @ingroup group_fs_file_descriptor |
no test coverage detected