xref: /nrf52832-nimble/rt-thread/components/libc/compilers/dlib/syscall_close.c (revision 104654410c56c573564690304ae786df310c91fc)
1 /*
2  * Copyright (c) 2006-2018, RT-Thread Development Team
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  *
6  * Change Logs:
7  * Date           Author       Notes
8  * 2015-01-28     Bernard      first version
9  */
10 #include <rtthread.h>
11 #ifdef RT_USING_DFS
12 #include <dfs_posix.h>
13 #endif
14 #include <yfuns.h>
15 
16 #pragma module_name = "?__close"
__close(int handle)17 int __close(int handle)
18 {
19     if (handle == _LLIO_STDOUT ||
20         handle == _LLIO_STDERR ||
21         handle == _LLIO_STDIN)
22         return _LLIO_ERROR;
23 
24 #ifdef RT_USING_DFS
25     return close(handle);
26 #else
27     return 0;
28 #endif
29 }
30