clarify the purpose of this project
[nyanglibc.git] / io / fchmodat.shared.s
blob7a15a8c68bf1232f852c0f209884d2179a88f32c
1 .text
2 #APP
3 memmove = __GI_memmove
4 memset = __GI_memset
5 memcpy = __GI_memcpy
6 .section .rodata.str1.1,"aMS",@progbits,1
7 .LC0:
8 .string ""
9 .LC1:
10 .string "/proc/self/fd/%d"
11 #NO_APP
12 .text
13 .p2align 4,,15
14 .globl __GI_fchmodat
15 .hidden __GI_fchmodat
16 .type __GI_fchmodat, @function
17 __GI_fchmodat:
18 pushq %r12
19 pushq %rbp
20 pushq %rbx
21 subq $176, %rsp
22 testl %ecx, %ecx
23 jne .L2
24 movl $268, %eax
25 #APP
26 # 32 "../sysdeps/unix/sysv/linux/fchmodat.c" 1
27 syscall
29 # 0 "" 2
30 #NO_APP
31 cmpq $-4096, %rax
32 ja .L3
33 addq $176, %rsp
34 movl %eax, %ebx
35 movl %ebx, %eax
36 popq %rbx
37 popq %rbp
38 popq %r12
39 ret
40 .p2align 4,,10
41 .p2align 3
42 .L2:
43 cmpl $256, %ecx
44 jne .L18
45 xorl %eax, %eax
46 movl %edx, %ebp
47 movl $2752512, %edx
48 call __GI___openat_nocancel
49 testl %eax, %eax
50 movl %eax, %ebx
51 jns .L19
52 .L1:
53 addq $176, %rsp
54 movl %ebx, %eax
55 popq %rbx
56 popq %rbp
57 popq %r12
58 ret
59 .p2align 4,,10
60 .p2align 3
61 .L19:
62 leaq 32(%rsp), %rdx
63 leaq .LC0(%rip), %rsi
64 movl $4096, %ecx
65 movl %eax, %edi
66 call __GI___fstatat64
67 testl %eax, %eax
68 jne .L16
69 movl 56(%rsp), %eax
70 andl $61440, %eax
71 cmpl $40960, %eax
72 je .L20
73 movq %rsp, %r12
74 leaq .LC1(%rip), %rdx
75 xorl %eax, %eax
76 movl %ebx, %ecx
77 movl $32, %esi
78 movq %r12, %rdi
79 call __GI___snprintf
80 testl %eax, %eax
81 js .L16
82 movl %ebp, %esi
83 movq %r12, %rdi
84 call __GI___chmod
85 testl %eax, %eax
86 movl %eax, %ebp
87 je .L11
88 movq __libc_errno@gottpoff(%rip), %rax
89 cmpl $2, %fs:(%rax)
90 jne .L11
91 movl $95, %fs:(%rax)
92 .p2align 4,,10
93 .p2align 3
94 .L11:
95 movl %ebx, %edi
96 movl %ebp, %ebx
97 call __GI___close_nocancel
98 jmp .L1
99 .p2align 4,,10
100 .p2align 3
101 .L16:
102 movl %ebx, %edi
103 movl $-1, %ebx
104 call __GI___close_nocancel
105 addq $176, %rsp
106 movl %ebx, %eax
107 popq %rbx
108 popq %rbp
109 popq %r12
111 .p2align 4,,10
112 .p2align 3
113 .L3:
114 movq __libc_errno@gottpoff(%rip), %rdx
115 negl %eax
116 movl $-1, %ebx
117 movl %eax, %fs:(%rdx)
118 jmp .L1
119 .p2align 4,,10
120 .p2align 3
121 .L18:
122 movq __libc_errno@gottpoff(%rip), %rax
123 movl $-1, %ebx
124 movl $22, %fs:(%rax)
125 jmp .L1
126 .p2align 4,,10
127 .p2align 3
128 .L20:
129 movl %ebx, %edi
130 movl $-1, %ebx
131 call __GI___close_nocancel
132 movq __libc_errno@gottpoff(%rip), %rax
133 movl $95, %fs:(%rax)
134 jmp .L1
135 .size __GI_fchmodat, .-__GI_fchmodat
136 .globl fchmodat
137 .set fchmodat,__GI_fchmodat