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