clarify the purpose of this project
[nyanglibc.git] / io / getwd.shared.s
blob897ad0dd6210b71dccd3e68e35b2b9e053c8f4a9
1 .text
2 #APP
3 memmove = __GI_memmove
4 memset = __GI_memset
5 memcpy = __GI_memcpy
6 .section .gnu.warning.getwd
7 .previous
8 #NO_APP
9 .p2align 4,,15
10 .globl getwd
11 .type getwd, @function
12 getwd:
13 pushq %r12
14 pushq %rbp
15 pushq %rbx
16 subq $4096, %rsp
17 testq %rdi, %rdi
18 je .L7
19 movq %rsp, %r12
20 movq %rdi, %rbx
21 movl $4096, %esi
22 movq %r12, %rdi
23 call __GI___getcwd
24 testq %rax, %rax
25 movq %rax, %rbp
26 je .L8
27 movq %r12, %rsi
28 movq %rbx, %rdi
29 movq %rbx, %rbp
30 call __GI_strcpy
31 .L1:
32 addq $4096, %rsp
33 movq %rbp, %rax
34 popq %rbx
35 popq %rbp
36 popq %r12
37 ret
38 .p2align 4,,10
39 .p2align 3
40 .L7:
41 movq __libc_errno@gottpoff(%rip), %rax
42 xorl %ebp, %ebp
43 movl $22, %fs:(%rax)
44 jmp .L1
45 .p2align 4,,10
46 .p2align 3
47 .L8:
48 movq __libc_errno@gottpoff(%rip), %rax
49 movl $1024, %edx
50 movq %rbx, %rsi
51 movl %fs:(%rax), %edi
52 call __GI___strerror_r
53 jmp .L1
54 .size getwd, .-getwd
55 .section .gnu.warning.getwd
56 #,"a",@progbits
57 .align 32
58 .type __evoke_link_warning_getwd, @object
59 .size __evoke_link_warning_getwd, 58
60 __evoke_link_warning_getwd:
61 .string "the `getwd' function is dangerous and should not be used."