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