mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-18 08:06:32 +00:00
Add dup,dup2 (#224)
* dup,dup2 * fix: sys_dup2语义与posix不一致的问题 --------- Co-authored-by: longjin <longjin@RinGoTek.cn>
This commit is contained in:
@ -400,6 +400,9 @@ uint64_t sys_pipe(struct pt_regs *regs)
|
||||
|
||||
extern uint64_t sys_mkdir(struct pt_regs *regs);
|
||||
|
||||
extern int sys_dup(int oldfd);
|
||||
extern int sys_dup2(int oldfd, int newfd);
|
||||
|
||||
system_call_t system_call_table[MAX_SYSTEM_CALL_NUM] = {
|
||||
[0] = system_call_not_exists,
|
||||
[1] = sys_put_string,
|
||||
@ -429,5 +432,7 @@ system_call_t system_call_table[MAX_SYSTEM_CALL_NUM] = {
|
||||
[25] = sys_rt_sigreturn,
|
||||
[26] = sys_getpid,
|
||||
[27] = sys_sched,
|
||||
[28 ... 255] = system_call_not_exists,
|
||||
[28] = sys_dup,
|
||||
[29] = sys_dup2,
|
||||
[30 ... 255] = system_call_not_exists,
|
||||
};
|
||||
|
@ -39,5 +39,7 @@
|
||||
#define SYS_RT_SIGRETURN 25 // 从信号处理函数返回
|
||||
#define SYS_GETPID 26 // 获取当前进程的pid(进程标识符)
|
||||
#define SYS_SCHED 27 // 让系统立即运行调度器(该系统调用不能由运行在Ring3的程序发起)
|
||||
#define SYS_DUP 28
|
||||
#define SYS_DUP2 29
|
||||
|
||||
#define SYS_AHCI_END_REQ 255 // AHCI DMA请求结束end_request的系统调用
|
Reference in New Issue
Block a user