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