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