clarify the purpose of this project
[nyanglibc.git] / login / getlogin.shared.s
blobfd119ebb46fd45be4714970b98019fb3aef7fa4c
1 .text
2 #APP
3 memmove = __GI_memmove
4 memset = __GI_memset
5 memcpy = __GI_memcpy
6 #NO_APP
7 .p2align 4,,15
8 .type getlogin_fd0, @function
9 getlogin_fd0:
10 pushq %rbx
11 xorl %edi, %edi
12 movl $512, %edx
13 subq $1296, %rsp
14 leaq 784(%rsp), %rbx
15 movq %rbx, %rsi
16 call __ttyname_r
17 testl %eax, %eax
18 jne .L9
19 call __setutent
20 leaq 5(%rbx), %rsi
21 leaq 24(%rsp), %rdi
22 movl $32, %edx
23 leaq 16(%rsp), %rbx
24 call __GI_strncpy
25 leaq 8(%rsp), %rdx
26 leaq 400(%rsp), %rsi
27 movq %rbx, %rdi
28 call __GI___getutline_r
29 testl %eax, %eax
30 jns .L4
31 movq __libc_errno@gottpoff(%rip), %rax
32 xorl %ebx, %ebx
33 cmpl $3, %fs:(%rax)
34 jne .L5
35 movl $2, %fs:(%rax)
36 jmp .L5
37 .p2align 4,,10
38 .p2align 3
39 .L4:
40 movq 8(%rsp), %rax
41 leaq name(%rip), %rdi
42 movl $32, %edx
43 leaq name(%rip), %rbx
44 leaq 44(%rax), %rsi
45 call __GI_strncpy
46 movb $0, 32+name(%rip)
47 .L5:
48 call __endutent
49 addq $1296, %rsp
50 movq %rbx, %rax
51 popq %rbx
52 ret
53 .p2align 4,,10
54 .p2align 3
55 .L9:
56 movq __libc_errno@gottpoff(%rip), %rdx
57 xorl %ebx, %ebx
58 movl %eax, %fs:(%rdx)
59 addq $1296, %rsp
60 movq %rbx, %rax
61 popq %rbx
62 ret
63 .size getlogin_fd0, .-getlogin_fd0
64 .p2align 4,,15
65 .globl getlogin
66 .type getlogin, @function
67 getlogin:
68 leaq name(%rip), %rdi
69 subq $8, %rsp
70 movl $33, %esi
71 call __getlogin_r_loginuid
72 testl %eax, %eax
73 js .L17
74 leaq name(%rip), %rax
75 movl $0, %edx
76 cmovne %rdx, %rax
77 addq $8, %rsp
78 ret
79 .p2align 4,,10
80 .p2align 3
81 .L17:
82 addq $8, %rsp
83 jmp getlogin_fd0
84 .size getlogin, .-getlogin
85 .local name
86 .comm name,33,32
87 .hidden __getlogin_r_loginuid
88 .hidden __endutent
89 .hidden __setutent
90 .hidden __ttyname_r