aboutsummaryrefslogtreecommitdiff
path: root/ft_read.s
diff options
context:
space:
mode:
Diffstat (limited to 'ft_read.s')
-rw-r--r--ft_read.s12
1 files changed, 12 insertions, 0 deletions
diff --git a/ft_read.s b/ft_read.s
index 00718e8..564f2fc 100644
--- a/ft_read.s
+++ b/ft_read.s
@@ -14,6 +14,18 @@ global _ft_read
; int ft_read(int, void*, size_t);
_ft_read:
+ cmp rdx, 0
+ je FT_READ_NO_SIZE
+ cmp rdi, 0
+ jl FT_READ_ERROR
+ cmp rsi, 0
+ je FT_READ_ERROR
mov rax, 0x2000003
syscall
ret
+FT_READ_ERROR:
+ mov rax, -1
+ ret
+FT_READ_NO_SIZE:
+ xor rax, rax
+ ret