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