clarify the purpose of this project
[nyanglibc.git] / io / poll.s
blob7ccd3efc7f9ce11f1489fee422e6bd86a30a5f45
1 .text
2 .p2align 4,,15
3 .globl __poll
4 .hidden __poll
5 .type __poll, @function
6 __poll:
7 #APP
8 # 29 "../sysdeps/unix/sysv/linux/poll.c" 1
9 movl %fs:24,%eax
10 # 0 "" 2
11 #NO_APP
12 testl %eax, %eax
13 jne .L2
14 movl $7, %eax
15 #APP
16 # 29 "../sysdeps/unix/sysv/linux/poll.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 %r12
28 pushq %rbp
29 movl %edx, %r12d
30 pushq %rbx
31 movq %rsi, %rbp
32 movq %rdi, %rbx
33 subq $16, %rsp
34 call __libc_enable_asynccancel
35 movl %r12d, %edx
36 movl %eax, %r8d
37 movq %rbp, %rsi
38 movq %rbx, %rdi
39 movl $7, %eax
40 #APP
41 # 29 "../sysdeps/unix/sysv/linux/poll.c" 1
42 syscall
44 # 0 "" 2
45 #NO_APP
46 cmpq $-4096, %rax
47 ja .L12
48 .L6:
49 movl %r8d, %edi
50 movl %eax, 12(%rsp)
51 call __libc_disable_asynccancel
52 movl 12(%rsp), %eax
53 addq $16, %rsp
54 popq %rbx
55 popq %rbp
56 popq %r12
57 ret
58 .p2align 4,,10
59 .p2align 3
60 .L11:
61 movq __libc_errno@gottpoff(%rip), %rdx
62 negl %eax
63 movl %eax, %fs:(%rdx)
64 movl $-1, %eax
65 ret
66 .L12:
67 movq __libc_errno@gottpoff(%rip), %rdx
68 negl %eax
69 movl %eax, %fs:(%rdx)
70 movl $-1, %eax
71 jmp .L6
72 .size __poll, .-__poll
73 .globl __libc_poll
74 .set __libc_poll,__poll
75 .weak poll
76 .set poll,__poll
77 .hidden __libc_disable_asynccancel
78 .hidden __libc_enable_asynccancel