clarify the purpose of this project
[nyanglibc.git] / dirent / fdopendir.s
blob694480bafa32db75c4e903bc9e5746cba49bca39
1 .text
2 .p2align 4,,15
3 .globl __fdopendir
4 .hidden __fdopendir
5 .type __fdopendir, @function
6 __fdopendir:
7 pushq %rbp
8 pushq %rbx
9 movl %edi, %ebx
10 subq $152, %rsp
11 movq %rsp, %rbp
12 movq %rbp, %rsi
13 call __fstat64
14 testl %eax, %eax
15 js .L11
16 movl 24(%rsp), %eax
17 andl $61440, %eax
18 cmpl $16384, %eax
19 jne .L13
20 xorl %eax, %eax
21 movl $3, %esi
22 movl %ebx, %edi
23 call __fcntl64_nocancel
24 cmpl $-1, %eax
25 je .L11
26 movl %eax, %edx
27 andl $3, %edx
28 cmpl $1, %edx
29 je .L14
30 movq %rbp, %rcx
31 movl %eax, %edx
32 xorl %esi, %esi
33 movl %ebx, %edi
34 call __alloc_dir
35 .L1:
36 addq $152, %rsp
37 popq %rbx
38 popq %rbp
39 ret
40 .p2align 4,,10
41 .p2align 3
42 .L13:
43 movq __libc_errno@gottpoff(%rip), %rax
44 movl $20, %fs:(%rax)
45 .L11:
46 addq $152, %rsp
47 xorl %eax, %eax
48 popq %rbx
49 popq %rbp
50 ret
51 .p2align 4,,10
52 .p2align 3
53 .L14:
54 movq __libc_errno@gottpoff(%rip), %rax
55 movl $22, %fs:(%rax)
56 xorl %eax, %eax
57 jmp .L1
58 .size __fdopendir, .-__fdopendir
59 .weak fdopendir
60 .set fdopendir,__fdopendir
61 .hidden __alloc_dir
62 .hidden __fcntl64_nocancel
63 .hidden __fstat64