source: asp3_tinet_ecnl_rx/trunk/musl-1.1.18/src/unistd/dup2.c@ 337

Last change on this file since 337 was 337, checked in by coas-nagasima, 6 years ago

ASP3版ECNLを追加

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/x-csrc;charset=UTF-8
File size: 380 bytes
Line 
1#include <unistd.h>
2#include <errno.h>
3#include <fcntl.h>
4#include "syscall.h"
5
6int dup2(int old, int new)
7{
8 int r;
9#ifdef SYS_dup2
10 while ((r=__syscall(SYS_dup2, old, new))==-EBUSY);
11#else
12 if (old==new) {
13 r = __syscall(SYS_fcntl, old, F_GETFD);
14 if (r >= 0) return old;
15 } else {
16 while ((r=__syscall(SYS_dup3, old, new, 0))==-EBUSY);
17 }
18#endif
19 return __syscall_ret(r);
20}
Note: See TracBrowser for help on using the repository browser.