Adds lstat()
This commit is contained in:
14
src/file.asm
14
src/file.asm
@@ -7,6 +7,7 @@ extern umask_get
|
||||
|
||||
section .text
|
||||
global stat
|
||||
global lstat
|
||||
global fgettype
|
||||
global fgetmod
|
||||
global fopen
|
||||
@@ -34,6 +35,19 @@ stat:
|
||||
add rsp, SIZE_QWORD
|
||||
ret
|
||||
|
||||
;----- lstat(*file[], *statBuffer[]) -----;
|
||||
; Same as stat, except do not follow links
|
||||
lstat:
|
||||
sub rsp, SIZE_QWORD
|
||||
mov rax, NR_newfstatat
|
||||
mov rdx, rsi
|
||||
mov rsi, rdi
|
||||
mov rdi, AT_FDCWD
|
||||
mov r10, AT_SYMLINK_NOFOLLOW
|
||||
syscall
|
||||
add rsp, SIZE_QWORD
|
||||
ret
|
||||
|
||||
;----- fgettype(*statBuffer[]) -----;
|
||||
; Gets file type from stat buffer
|
||||
; Return value: Permissions of given file or -EINVAL if statBuffer is invalid (first bit is 0)
|
||||
|
Reference in New Issue
Block a user