clarify the purpose of this project
[nyanglibc.git] / posix / setuid.s
blobc1004bd4c72cb5e10ff51cd16b619cc28de11099
1 .text
2 .p2align 4,,15
3 .globl __setuid
4 .type __setuid, @function
5 __setuid:
6 cmpq $0, __nptl_setxid@GOTPCREL(%rip)
7 jne .L11
8 movl $105, %eax
9 #APP
10 # 28 "../sysdeps/unix/sysv/linux/setuid.c" 1
11 syscall
13 # 0 "" 2
14 #NO_APP
15 cmpq $-4096, %rax
16 ja .L12
17 rep ret
18 .p2align 4,,10
19 .p2align 3
20 .L11:
21 subq $56, %rsp
22 movl %edi, %eax
23 movq %rsp, %rdi
24 movl $105, (%rsp)
25 movq %rax, 8(%rsp)
26 call __nptl_setxid@PLT
27 addq $56, %rsp
28 ret
29 .p2align 4,,10
30 .p2align 3
31 .L12:
32 movq __libc_errno@gottpoff(%rip), %rdx
33 negl %eax
34 movl %eax, %fs:(%rdx)
35 movl $-1, %eax
36 ret
37 .size __setuid, .-__setuid
38 .weak setuid
39 .set setuid,__setuid
40 .weak __nptl_setxid
41 .hidden __nptl_setxid