From eb1c714127f7602729bc03e85dfad72115480912 Mon Sep 17 00:00:00 2001 From: Kwarde Date: Thu, 24 Jul 2025 15:23:25 +0200 Subject: [PATCH] Optimize umask_get (make it a leaf function) --- src/core.asm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core.asm b/src/core.asm index bab4939..0fe6ba0 100644 --- a/src/core.asm +++ b/src/core.asm @@ -199,10 +199,12 @@ umask_set: ; rdi* syscall arg ; rdx* Stores umask for restoring+returning umask umask_get: + mov rax, NR_umask xor rdi, rdi - call umask_set + syscall mov rdx, rax mov rdi, rax - call umask_set + mov rax, NR_umask + syscall mov rax, rdx ret