syscall_remove.c 594 B

12345678910111213141516171819202122232425262728
  1. /*
  2. * Copyright (c) 2006-2021, 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. #include <LowLevelIOInterface.h>
  12. #include <unistd.h>
  13. /*
  14. * The "remove" function should remove the file named "filename". It
  15. * should return 0 on success and nonzero on failure.
  16. */
  17. #pragma module_name = "?remove"
  18. int remove(const char *filename)
  19. {
  20. #ifdef DFS_USING_POSIX
  21. return unlink(filename);
  22. #else
  23. return _LLIO_ERROR;
  24. #endif /* DFS_USING_POSIX */
  25. }