summaryrefslogtreecommitdiff
path: root/src/unistd/dup2.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/unistd/dup2.c')
-rw-r--r--src/unistd/dup2.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/unistd/dup2.c b/src/unistd/dup2.c
index 7945f853..87a0d445 100644
--- a/src/unistd/dup2.c
+++ b/src/unistd/dup2.c
@@ -1,7 +1,10 @@
#include <unistd.h>
+#include <errno.h>
#include "syscall.h"
int dup2(int old, int new)
{
- return syscall(SYS_dup2, old, new);
+ int r;
+ while ((r=__syscall(SYS_dup2, old, new))==-EBUSY);
+ return __syscall_ret(r);
}