fstatat -> stat, fgettype/fgetmod: rax->eax (st_mode is dword, not qword)
This commit is contained in:
13
src/file.asm
13
src/file.asm
@@ -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) -----;
|
||||
|
Reference in New Issue
Block a user