From e660665dfd06ac0f6da2d000cc6a8d2a2bae87b2 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Sun, 11 Nov 2018 10:13:01 +0100 Subject: [PATCH] mescc: dup, dup2: Move to libc. * lib/linux/libc.c (dup, dup2): New function. * lib/linux/gnu.c (dup, dup2): Remove. --- lib/linux/gnu.c | 12 ------------ lib/linux/libc.c | 12 ++++++++++++ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/linux/gnu.c b/lib/linux/gnu.c index 753713ff..402f30e1 100644 --- a/lib/linux/gnu.c +++ b/lib/linux/gnu.c @@ -57,12 +57,6 @@ mkdir (char const *file_name, mode_t mode) return _sys_call2 (SYS_mkdir, (long)file_name, (long)mode); } -int -dup (int old) -{ - return _sys_call1 (SYS_dup, (int)old); -} - gid_t getgid () { @@ -124,12 +118,6 @@ pipe (int filedes[2]) return _sys_call1 (SYS_pipe, (long)filedes); } -int -dup2 (int old, int new) -{ - return _sys_call2 (SYS_dup2, (int)old, (int)new); -} - int getrusage (int processes, struct rusage *rusage) { diff --git a/lib/linux/libc.c b/lib/linux/libc.c index 28114e53..0e093ec3 100644 --- a/lib/linux/libc.c +++ b/lib/linux/libc.c @@ -159,6 +159,18 @@ getcwd (char *buffer, size_t size) return 0; } +int +dup (int old) +{ + return _sys_call1 (SYS_dup, (int)old); +} + +int +dup2 (int old, int new) +{ + return _sys_call2 (SYS_dup2, (int)old, (int)new); +} + #include "linux/clock_gettime.c" #include "linux/gettimeofday.c" #include "linux/time.c"