18f6fccef24fb12fdc83a72958d3423618ae7a1d
[musl] / src / unistd / dup3.c
1 #define _GNU_SOURCE
2 #include <unistd.h>
3 #include <errno.h>
4 #include "syscall.h"
5
6 int dup3(int old, int new, int flags) {
7         int r;
8         while ((r=__syscall(SYS_dup3, old, new, flags))==-EBUSY);
9         return __syscall_ret(r);
10 }