Add (basic) tests for stat(), fgettype(), fgetmod()

This commit is contained in:
2025-07-27 14:49:24 +02:00
parent efd35b2957
commit 40583103a1
2 changed files with 116 additions and 6 deletions

View File

@@ -20,10 +20,10 @@ section .text
; Used registers:
; rax* (ret)
; rdi* (arg) Pointer to file
; rsi* (arg) Pointer to statBuffer
; rsi* arg for syscall NR_newfstatat
; rdx* arg for syscall NR_newfstatat
; r10* arg(flag) for syscall NR_newfstatat
fstatat:
stat:
sub rsp, SIZE_QWORD
mov rax, NR_newfstatat
mov rdx, rsi
@@ -46,7 +46,7 @@ fgettype:
mov rax, -EINVAL
ret
.buffok:
mov eax, dword [rdi + ST_MODE]
mov eax, [rdi + ST_MODE]
and eax, 0xF000
ret