Bench algo working

This commit is contained in:
2026-01-08 15:28:07 +00:00
parent 173c11c2e3
commit 38eae5ab16
8 changed files with 247 additions and 4 deletions

20
secure_write.c Normal file
View File

@@ -0,0 +1,20 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* secure_write.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: dgaillet <dgaillet@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2026/01/08 14:30:38 by dgaillet #+# #+# */
/* Updated: 2026/01/08 14:32:19 by dgaillet ### ########lyon.fr */
/* */
/* ************************************************************************** */
#include <unistd.h>
#include <stdlib.h>
void secure_write(int fd, char *str, int len)
{
if (write(fd, str, len) < 0)
exit ( EXIT_FAILURE );
}