aboutsummaryrefslogtreecommitdiff
path: root/file.inc
diff options
context:
space:
mode:
Diffstat (limited to 'file.inc')
-rw-r--r--file.inc17
1 files changed, 16 insertions, 1 deletions
diff --git a/file.inc b/file.inc
index 3415c4f..bfbf8e0 100644
--- a/file.inc
+++ b/file.inc
@@ -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