fstatat -> stat, fgettype/fgetmod: rax->eax (st_mode is dword, not qword)

This commit is contained in:
2025-07-27 14:19:09 +02:00
parent dbf2af0253
commit efd35b2957
2 changed files with 25 additions and 6 deletions

View File

@@ -6,14 +6,15 @@ extern strlen
extern umask_get
section .text
global fstatat
global stat
global fgettype
global fgetmod
global fopen
global fclose
global fexist
global fwrite
;----- fstatat(*file[], *statBuffer[]) -----;
;----- stat(*file[], *statBuffer[]) -----;
; Gets information from a file, stores it into statBuffer[]
; Return value: 0 if stats received, -errno otherwise
; Used registers:
@@ -45,8 +46,8 @@ fgettype:
mov rax, -EINVAL
ret
.buffok:
mov rax, [rdi + ST_MODE]
and rax, 0xF000
mov eax, dword [rdi + ST_MODE]
and eax, 0xF000
ret
;----- fgetmod(*statBuffer[]) -----;
@@ -61,8 +62,8 @@ fgetmod:
mov rax, -EINVAL
ret
.buffok:
mov rax, [rdi + ST_MODE]
and rax, 0x0FFF
mov eax, [rdi + ST_MODE]
and eax, 0x0FFF
ret
;----- fopen(*file[], char mode) -----;