add: ft_write

This commit is contained in:
starnakin 2024-09-02 17:22:08 +02:00
parent 5bccb1efc6
commit 054e31a020
3 changed files with 13 additions and 1 deletions

View File

@ -1,7 +1,9 @@
#pragma once
#include <stddef.h>
#include <aio.h>
char *ft_strcpy(char *dest, const char *src);
size_t ft_strlen(const char *str);
int ft_strcmp( const char *first, const char *second);
int ft_strcmp( const char *first, const char *second);
ssize_t ft_write(int fd, const void *buf, size_t count);

8
src/ft_write.asm Normal file
View File

@ -0,0 +1,8 @@
section .note.GNU-stack noalloc noexec progbits
section .text
global ft_write
ft_write:
mov rax, 1
syscall
ret

View File

@ -76,4 +76,6 @@ int main()
const char *strcpy_tests[] = {"yo", "", "bonjour", "co\0fgf", NULL};
multiple_test_strcpy(ft_strcpy, strcpy_tests);
printf("\n");
ft_write(1, "bozo\n", 5);
}