diff options
Diffstat (limited to 'file.inc')
-rw-r--r-- | file.inc | 17 |
1 files changed, 16 insertions, 1 deletions
@@ -1,6 +1,7 @@ %ifndef FILE_INC %define FILE_INC -%define FBUF_DEFAULT_SIZE 1024*32 +%define FBUF_DEFAULT_SIZE 16 +%define FBUF_ALLOC_SIZE 1024*32 %ifndef SYS_INC %include "sys.inc" %endif @@ -96,6 +97,20 @@ ffopen: pop rbp ret +ffread: + push rbp + mov rbp, rsp + mov rdi, [rax + fd] + mov rdi, [rdi] + mov rsi, [rax + buffer] + mov rdx, [rax + size] + mov rax, SYS_READ + syscall + ;; + mov rsp, rbp + pop rbp + ret + print_filedata: push rbp mov rbp, rsp |