bit more consistent prepare for other primitives

This commit is contained in:
twoneis 2025-04-03 23:51:23 +02:00
parent e700ab4b60
commit 8d5a56f5f1
3 changed files with 23 additions and 9 deletions

16
code/pipe_utils.c Normal file
View file

@ -0,0 +1,16 @@
#define _GNU_SOURCE
#include <sys/socket.h>
#include <fcntl.h>
#include <unistd.h>
#include "pipe_utils.h"
void
allocation_primitive(int fd[2])
{
pipe2(fd, O_NONBLOCK);
fcntl(fd[0], F_SETPIPE_SZ, 8192);
char buffer[0x100] = { 0 };
write(fd[1], buffer, 8);
}