* This function will get the file descriptor table of current process. */
| 497 | * This function will get the file descriptor table of current process. |
| 498 | */ |
| 499 | struct dfs_fdtable *dfs_fdtable_get(void) |
| 500 | { |
| 501 | struct dfs_fdtable *fdt; |
| 502 | #ifdef RT_USING_SMART |
| 503 | struct rt_lwp *lwp = NULL; |
| 504 | rt_thread_t thread = rt_thread_self(); |
| 505 | |
| 506 | if (thread) |
| 507 | { |
| 508 | lwp = (struct rt_lwp *)thread->lwp; |
| 509 | } |
| 510 | |
| 511 | if (lwp) |
| 512 | fdt = &lwp->fdt; |
| 513 | else |
| 514 | fdt = &_fdtab; |
| 515 | #else |
| 516 | fdt = &_fdtab; |
| 517 | #endif |
| 518 | |
| 519 | return fdt; |
| 520 | } |
| 521 | |
| 522 | #ifdef RT_USING_SMART |
| 523 | /** |
no test coverage detected