38 lines
603 B
C
38 lines
603 B
C
#include <sys/socket.h>
|
|
|
|
#include <fcntl.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
#include <unistd.h>
|
|
|
|
// where does this come from?
|
|
#define OBJS_PER_SLAB 42
|
|
|
|
#define PIPE_BUFFER (OBJS_PER_SLAB * 10)
|
|
|
|
int pipes[PIPE_BUFFER][2];
|
|
|
|
void alloc_pipes(int[2], int);
|
|
|
|
int
|
|
main(void)
|
|
{
|
|
printf("main: start\n");
|
|
FILE *device = fopen("/dev/lkm", "r+");
|
|
|
|
printf("main: fopen: %p\n", device);
|
|
|
|
for (size_t i = 0; i < PIPE_BUFFER; i++) {
|
|
alloc_pipes(pipes[i], O_NONBLOCK);
|
|
}
|
|
|
|
fclose(device);
|
|
printf("main: done\n");
|
|
}
|
|
|
|
void
|
|
alloc_pipes(int fd[2], int flags)
|
|
{
|
|
pipe2(pipes, flags);
|
|
}
|