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