clarify the purpose of this project
[nyanglibc.git] / resource / vlimit.s
blob44954b1eb367ed6dd8b0f8042e940f4d1bf2b80b
1 .text
2 .p2align 4,,15
3 .globl vlimit
4 .type vlimit, @function
5 vlimit:
6 pushq %r12
7 pushq %rbp
8 pushq %rbx
9 leal -1(%rdi), %ebx
10 subq $16, %rsp
11 cmpl $5, %ebx
12 ja .L2
13 movq %rsp, %r12
14 movl %esi, %ebp
15 movl %ebx, %edi
16 movq %r12, %rsi
17 call __getrlimit
18 testl %eax, %eax
19 movl $-1, %edx
20 js .L1
21 movslq %ebp, %rsi
22 movl %ebx, %edi
23 movq %rsi, (%rsp)
24 movq %r12, %rsi
25 call __setrlimit
26 movl %eax, %edx
27 .L1:
28 addq $16, %rsp
29 movl %edx, %eax
30 popq %rbx
31 popq %rbp
32 popq %r12
33 ret
34 .p2align 4,,10
35 .p2align 3
36 .L2:
37 movq __libc_errno@gottpoff(%rip), %rax
38 movl $-1, %edx
39 movl $22, %fs:(%rax)
40 jmp .L1
41 .size vlimit, .-vlimit
42 .hidden __setrlimit
43 .hidden __getrlimit