* @brief Get file structure by file descriptor from current process's fd table * * @param[in] fd The file descriptor to lookup * * @return struct dfs_file* Pointer to the file structure if found, * NULL if invalid fd or file not found */
| 485 | * NULL if invalid fd or file not found |
| 486 | */ |
| 487 | struct dfs_file *fd_get(int fd) |
| 488 | { |
| 489 | struct dfs_fdtable *fdt; |
| 490 | |
| 491 | fdt = dfs_fdtable_get(); |
| 492 | |
| 493 | return fdt_get_file(fdt, fd); |
| 494 | } |
| 495 | |
| 496 | /** |
| 497 | * This function will get the file descriptor table of current process. |