clarify the purpose of this project
[nyanglibc.git] / stdio-common / remove.s
blobd290c277fd60dd0fe807ba9688da48512fc3aa81
1 .text
2 .p2align 4,,15
3 .globl remove
4 .hidden remove
5 .type remove, @function
6 remove:
7 pushq %rbx
8 movq %rdi, %rbx
9 call __unlink
10 testl %eax, %eax
11 je .L1
12 movq __libc_errno@gottpoff(%rip), %rdx
13 movl $-1, %eax
14 cmpl $21, %fs:(%rdx)
15 jne .L1
16 movq %rbx, %rdi
17 call __rmdir
18 testl %eax, %eax
19 setne %al
20 movzbl %al, %eax
21 negl %eax
22 .L1:
23 popq %rbx
24 ret
25 .size remove, .-remove
26 .hidden __rmdir
27 .hidden __unlink