clarify the purpose of this project
[nyanglibc.git] / io / dup2.s
blob47f5853e28c9537f17a58d85a6529cd018bcd9a9
1 .text
2 .globl __dup2
3 .type __dup2,@function
4 .align 1<<4
5 __dup2:
6 movl $33, %eax
7 syscall
8 cmpq $-4095, %rax
9 jae 0f
10 ret
12 movq __libc_errno@GOTTPOFF(%rip), %rcx
13 neg %eax
14 movl %eax, %fs:(%rcx)
15 or $-1, %rax
16 ret
17 .size __dup2,.-__dup2
18 .weak dup2
19 dup2 = __dup2