clarify the purpose of this project
[nyanglibc.git] / grp / getgrent.s
blob2f4cae197277e44d5f3c18b2fb82036f391a0024
1 .text
2 #APP
3 .section __libc_freeres_ptrs, "aw", %nobits
4 .previous
5 .section .gnu.warning.getgrent
6 .previous
7 #NO_APP
8 .p2align 4,,15
9 .globl getgrent
10 .type getgrent, @function
11 getgrent:
12 .LFB70:
13 pushq %rbx
14 #APP
15 # 81 "../nss/getXXent.c" 1
16 movl %fs:24,%eax
17 # 0 "" 2
18 #NO_APP
19 testl %eax, %eax
20 jne .L2
21 movl $1, %edx
22 #APP
23 # 47 "../sysdeps/unix/sysv/linux/x86/lowlevellock.h" 1
24 cmpxchgl %edx, lock(%rip)
25 # 0 "" 2
26 #NO_APP
27 .L3:
28 leaq buffer_size.10602(%rip), %r8
29 leaq buffer(%rip), %rdx
30 leaq resbuf.10606(%rip), %rsi
31 leaq __getgrent_r(%rip), %rdi
32 xorl %r9d, %r9d
33 movl $1024, %ecx
34 call __nss_getent
35 movq __libc_errno@gottpoff(%rip), %r8
36 movq %rax, %r9
37 movl %fs:(%r8), %ebx
38 #APP
39 # 89 "../nss/getXXent.c" 1
40 movl %fs:24,%eax
41 # 0 "" 2
42 #NO_APP
43 testl %eax, %eax
44 jne .L4
45 subl $1, lock(%rip)
46 .L5:
47 movl %ebx, %fs:(%r8)
48 movq %r9, %rax
49 popq %rbx
50 ret
51 .p2align 4,,10
52 .p2align 3
53 .L2:
54 xorl %eax, %eax
55 movl $1, %edx
56 lock cmpxchgl %edx, lock(%rip)
57 je .L3
58 leaq lock(%rip), %rdi
59 call __lll_lock_wait_private
60 jmp .L3
61 .p2align 4,,10
62 .p2align 3
63 .L4:
64 xorl %eax, %eax
65 #APP
66 # 89 "../nss/getXXent.c" 1
67 xchgl %eax, lock(%rip)
68 # 0 "" 2
69 #NO_APP
70 cmpl $1, %eax
71 jle .L5
72 xorl %r10d, %r10d
73 movl $1, %edx
74 movl $129, %esi
75 leaq lock(%rip), %rdi
76 movl $202, %eax
77 #APP
78 # 89 "../nss/getXXent.c" 1
79 syscall
81 # 0 "" 2
82 #NO_APP
83 jmp .L5
84 .LFE70:
85 .size getgrent, .-getgrent
86 .local buffer_size.10602
87 .comm buffer_size.10602,8,8
88 .local resbuf.10606
89 .comm resbuf.10606,32,32
90 .section .gnu.warning.getgrent
91 #,"a",@progbits
92 .align 32
93 .type __evoke_link_warning_getgrent, @object
94 .size __evoke_link_warning_getgrent, 132
95 __evoke_link_warning_getgrent:
96 .string "Using 'getgrent' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking"
97 .section __libc_freeres_ptrs
98 #,"aw",@progbits
99 .align 8
100 .type buffer, @object
101 .size buffer, 8
102 buffer:
103 .zero 8
104 .local lock
105 .comm lock,4,4
106 .hidden __lll_lock_wait_private
107 .hidden __nss_getent
108 .hidden __getgrent_r