mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-19 13:16:31 +00:00
new: devfs删除文件夹
This commit is contained in:
@ -3,12 +3,12 @@
|
||||
|
||||
|
||||
/**
|
||||
* @brief 目录项的属性(copy from vfs.h)
|
||||
* @brief inode的属性(copy from vfs.h)
|
||||
*
|
||||
*/
|
||||
#define VFS_ATTR_FILE (1UL << 0)
|
||||
#define VFS_ATTR_DIR (1UL << 1)
|
||||
#define VFS_ATTR_DEVICE (1UL << 2)
|
||||
#define VFS_IF_FILE (1UL << 0)
|
||||
#define VFS_IF_DIR (1UL << 1)
|
||||
#define VFS_IF_DEVICE (1UL << 2)
|
||||
|
||||
#define DIR_BUF_SIZE 256
|
||||
/**
|
||||
|
@ -142,7 +142,19 @@ int execv(const char *path, char *const argv[])
|
||||
return -1;
|
||||
}
|
||||
int retval = syscall_invoke(SYS_EXECVE, (uint64_t)path, (uint64_t)argv, 0, 0, 0, 0, 0, 0);
|
||||
if(retval != 0)
|
||||
if (retval != 0)
|
||||
return -1;
|
||||
else return 0;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 删除文件夹
|
||||
*
|
||||
* @param path 绝对路径
|
||||
* @return int 错误码
|
||||
*/
|
||||
int rmdir(const char *path)
|
||||
{
|
||||
return syscall_invoke(SYS_RMDIR, (uint64_t)path, 0, 0, 0, 0, 0, 0, 0);
|
||||
}
|
@ -97,3 +97,11 @@ int execv(const char* path, char * const argv[]);
|
||||
* @return int
|
||||
*/
|
||||
extern int usleep(useconds_t usec);
|
||||
|
||||
/**
|
||||
* @brief 删除文件夹
|
||||
*
|
||||
* @param path 绝对路径
|
||||
* @return int 错误码
|
||||
*/
|
||||
int rmdir(const char* path);
|
@ -27,6 +27,7 @@
|
||||
#define SYS_PIPE 20
|
||||
|
||||
#define SYS_MSTAT 21 // 获取系统的内存状态信息
|
||||
#define SYS_RMDIR 22 // 删除文件夹
|
||||
|
||||
/**
|
||||
* @brief 用户态系统调用函数
|
||||
|
Reference in New Issue
Block a user