clarify the purpose of this project
[nyanglibc.git] / nptl / close.s
blobb020c6ba122cc5f592cd6cfe8ae52c068c21a05e
1 .text
2 .p2align 4,,15
3 .globl __close
4 .type __close, @function
5 __close:
6 #APP
7 # 27 "../sysdeps/unix/sysv/linux/close.c" 1
8 movl %fs:24,%eax
9 # 0 "" 2
10 #NO_APP
11 testl %eax, %eax
12 jne .L2
13 movl $3, %eax
14 #APP
15 # 27 "../sysdeps/unix/sysv/linux/close.c" 1
16 syscall
18 # 0 "" 2
19 #NO_APP
20 cmpq $-4096, %rax
21 ja .L11
22 rep ret
23 .p2align 4,,10
24 .p2align 3
25 .L2:
26 pushq %rbx
27 movl %edi, %ebx
28 subq $16, %rsp
29 call __pthread_enable_asynccancel@PLT
30 movl %ebx, %edi
31 movl %eax, %edx
32 movl $3, %eax
33 #APP
34 # 27 "../sysdeps/unix/sysv/linux/close.c" 1
35 syscall
37 # 0 "" 2
38 #NO_APP
39 cmpq $-4096, %rax
40 ja .L12
41 .L6:
42 movl %edx, %edi
43 movl %eax, 12(%rsp)
44 call __pthread_disable_asynccancel@PLT
45 movl 12(%rsp), %eax
46 addq $16, %rsp
47 popq %rbx
48 ret
49 .p2align 4,,10
50 .p2align 3
51 .L11:
52 movq errno@gottpoff(%rip), %rdx
53 negl %eax
54 movl %eax, %fs:(%rdx)
55 movl $-1, %eax
56 ret
57 .L12:
58 movq errno@gottpoff(%rip), %rcx
59 negl %eax
60 movl %eax, %fs:(%rcx)
61 movl $-1, %eax
62 jmp .L6
63 .size __close, .-__close
64 .weak close
65 .set close,__close
66 .globl __libc_close
67 .set __libc_close,__close