- .globl _errno
-
-LABEL(cerror)
- PICIFY(_errno) /* address -> %r11 */
- movl %eax,(%r11)
- mov %rsp,%rdx
- andq $-16,%rsp
- subq $16,%rsp
- // Preserve the original stack
- movq %rdx,(%rsp)
- movq %rax,%rdi
- CALL_EXTERN(_cthread_set_errno_self)
- // Restore the original stack
- movq (%rsp),%rsp
- movq $-1,%rax
- movq $-1,%rdx /* in case a 128-bit value is returned */
- ret