linux: Add sys_dup2() sysdep
#define NR_exit_group 231
#define NR_tgkill 234
#define NR_pselect6 270
+#define NR_dup3 292
#define NR_pipe2 293
#define ARCH_SET_FS 0x1002
@@ -98,6 +99,13 @@ int sys_close(int fd) {
return 0;
}
+int sys_dup2(int fd, int flags, int newfd) {
+ auto ret = do_cp_syscall(NR_dup3, fd, newfd, flags);
+ if(int e = sc_error(ret); e)
+ return e;
+ return 0;
+}
+
int sys_read(int fd, void *buffer, size_t size, ssize_t *bytes_read) {
auto ret = do_cp_syscall(NR_read, fd, buffer, size);
if(int e = sc_error(ret); e)
