syscall_remove.c 743 B

123456789101112131415161718192021222324252627282930313233
  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. #include <compiler_private.h>
  14. #define DBG_TAG "dlib.syscall.remove"
  15. #define DBG_LVL DBG_INFO
  16. #include <rtdbg.h>
  17. /*
  18. * The "remove" function should remove the file named "filename". It
  19. * should return 0 on success and nonzero on failure.
  20. */
  21. #pragma module_name = "?remove"
  22. int remove(const char *filename)
  23. {
  24. #ifdef DFS_USING_POSIX
  25. return unlink(filename);
  26. #else
  27. LOG_W(warning_without_fs);
  28. return _LLIO_ERROR;
  29. #endif /* DFS_USING_POSIX */
  30. }