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