Kernel/LibC: add dup() syscall and function
This commit is contained in:
@@ -40,13 +40,14 @@ __BEGIN_DECLS
|
||||
#define SYS_SET_PWD 33
|
||||
#define SYS_CLOCK_GETTIME 34
|
||||
#define SYS_PIPE 35
|
||||
#define SYS_DUP2 36
|
||||
#define SYS_RAISE 37
|
||||
#define SYS_KILL 38
|
||||
#define SYS_SIGNAL 39
|
||||
#define SYS_SIGNAL_DONE 40
|
||||
#define SYS_TCSETPGRP 41
|
||||
#define SYS_GET_PID 42
|
||||
#define SYS_DUP 36
|
||||
#define SYS_DUP2 37
|
||||
#define SYS_RAISE 38
|
||||
#define SYS_KILL 39
|
||||
#define SYS_SIGNAL 40
|
||||
#define SYS_SIGNAL_DONE 41
|
||||
#define SYS_TCSETPGRP 42
|
||||
#define SYS_GET_PID 43
|
||||
|
||||
__END_DECLS
|
||||
|
||||
|
||||
@@ -61,6 +61,11 @@ ssize_t write(int fildes, const void* buf, size_t nbyte)
|
||||
return syscall(SYS_WRITE, fildes, buf, nbyte);
|
||||
}
|
||||
|
||||
int dup(int fildes)
|
||||
{
|
||||
return syscall(SYS_DUP, fildes);
|
||||
}
|
||||
|
||||
int dup2(int fildes, int fildes2)
|
||||
{
|
||||
return syscall(SYS_DUP2, fildes, fildes2);
|
||||
|
||||
Reference in New Issue
Block a user