clarify the purpose of this project
[nyanglibc.git] / io / write.shared.s
blob28bb40989ee8e8cc30754264d76313719a8f17c8
1 .text
2 #APP
3 memmove = __GI_memmove
4 memset = __GI_memset
5 memcpy = __GI_memcpy
6 #NO_APP
7 .p2align 4,,15
8 .globl __GI___libc_write
9 .hidden __GI___libc_write
10 .type __GI___libc_write, @function
11 __GI___libc_write:
12 #APP
13 # 26 "../sysdeps/unix/sysv/linux/write.c" 1
14 movl %fs:24,%eax
15 # 0 "" 2
16 #NO_APP
17 testl %eax, %eax
18 jne .L2
19 movl $1, %eax
20 #APP
21 # 26 "../sysdeps/unix/sysv/linux/write.c" 1
22 syscall
24 # 0 "" 2
25 #NO_APP
26 cmpq $-4096, %rax
27 ja .L9
28 rep ret
29 .p2align 4,,10
30 .p2align 3
31 .L2:
32 pushq %r12
33 pushq %rbp
34 movq %rdx, %r12
35 pushq %rbx
36 movq %rsi, %rbp
37 movl %edi, %ebx
38 subq $16, %rsp
39 call __libc_enable_asynccancel
40 movq %r12, %rdx
41 movl %eax, %r8d
42 movq %rbp, %rsi
43 movl %ebx, %edi
44 movl $1, %eax
45 #APP
46 # 26 "../sysdeps/unix/sysv/linux/write.c" 1
47 syscall
49 # 0 "" 2
50 #NO_APP
51 cmpq $-4096, %rax
52 ja .L10
53 .L4:
54 movl %r8d, %edi
55 movq %rax, 8(%rsp)
56 call __libc_disable_asynccancel
57 movq 8(%rsp), %rax
58 addq $16, %rsp
59 popq %rbx
60 popq %rbp
61 popq %r12
62 ret
63 .p2align 4,,10
64 .p2align 3
65 .L9:
66 movq __libc_errno@gottpoff(%rip), %rdx
67 negl %eax
68 movl %eax, %fs:(%rdx)
69 movq $-1, %rax
70 ret
71 .L10:
72 movq __libc_errno@gottpoff(%rip), %rdx
73 negl %eax
74 movl %eax, %fs:(%rdx)
75 movq $-1, %rax
76 jmp .L4
77 .size __GI___libc_write, .-__GI___libc_write
78 .globl __libc_write
79 .set __libc_write,__GI___libc_write
80 .weak __GI_write
81 .hidden __GI_write
82 .set __GI_write,__libc_write
83 .weak write
84 .set write,__GI_write
85 .weak __GI___write
86 .hidden __GI___write
87 .set __GI___write,__libc_write
88 .weak __write
89 .set __write,__GI___write
90 .hidden __libc_disable_asynccancel
91 .hidden __libc_enable_asynccancel