clarify the purpose of this project
[nyanglibc.git] / io / lockf64.s
blob59624a32aca4315f6706090da4b25238c3048b57
1 .text
2 .p2align 4,,15
3 .globl __lockf64
4 .type __lockf64, @function
5 __lockf64:
6 pushq %rbx
7 pxor %xmm0, %xmm0
8 subq $32, %rsp
9 cmpl $1, %esi
10 movups %xmm0, 4(%rsp)
11 movq $0, 20(%rsp)
12 movl $0, 28(%rsp)
13 movl $65537, (%rsp)
14 movq %rdx, 16(%rsp)
15 je .L3
16 jle .L14
17 cmpl $2, %esi
18 je .L6
19 cmpl $3, %esi
20 jne .L2
21 xorl %edx, %edx
22 xorl %eax, %eax
23 movl $5, %esi
24 movw %dx, (%rsp)
25 movq %rsp, %rdx
26 call __fcntl
27 testl %eax, %eax
28 js .L11
29 cmpw $2, (%rsp)
30 je .L10
31 movl 24(%rsp), %ebx
32 call __getpid
33 cmpl %eax, %ebx
34 jne .L15
35 .L10:
36 addq $32, %rsp
37 xorl %eax, %eax
38 popq %rbx
39 ret
40 .p2align 4,,10
41 .p2align 3
42 .L6:
43 movq %rsp, %rdx
44 movl $6, %esi
45 xorl %eax, %eax
46 call __fcntl64
47 .L1:
48 addq $32, %rsp
49 popq %rbx
50 ret
51 .p2align 4,,10
52 .p2align 3
53 .L14:
54 testl %esi, %esi
55 jne .L2
56 movl $2, %eax
57 movq %rsp, %rdx
58 movl $6, %esi
59 movw %ax, (%rsp)
60 xorl %eax, %eax
61 call __fcntl64
62 addq $32, %rsp
63 popq %rbx
64 ret
65 .p2align 4,,10
66 .p2align 3
67 .L2:
68 movq __libc_errno@gottpoff(%rip), %rax
69 movl $22, %fs:(%rax)
70 addq $32, %rsp
71 movl $-1, %eax
72 popq %rbx
73 ret
74 .p2align 4,,10
75 .p2align 3
76 .L3:
77 movq %rsp, %rdx
78 movl $7, %esi
79 xorl %eax, %eax
80 call __fcntl64
81 addq $32, %rsp
82 popq %rbx
83 ret
84 .L15:
85 movq __libc_errno@gottpoff(%rip), %rax
86 movl $13, %fs:(%rax)
87 movl $-1, %eax
88 jmp .L1
89 .L11:
90 movl $-1, %eax
91 jmp .L1
92 .size __lockf64, .-__lockf64
93 .weak lockf64
94 .set lockf64,__lockf64
95 .weak lockf
96 .set lockf,lockf64
97 .hidden __fcntl64
98 .hidden __getpid
99 .hidden __fcntl