syscall_close.c 559 B

1234567891011121314151617181920212223242526272829
  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. #pragma module_name = "?__close"
  16. int __close(int handle)
  17. {
  18. if (handle == _LLIO_STDOUT ||
  19. handle == _LLIO_STDERR ||
  20. handle == _LLIO_STDIN)
  21. return _LLIO_ERROR;
  22. #ifdef RT_USING_DFS
  23. return close(handle);
  24. #else
  25. return 0;
  26. #endif
  27. }