alloc pipes
This commit is contained in:
parent
4d08c68e78
commit
e700ab4b60
2 changed files with 278 additions and 222 deletions
25
code/leak.c
25
code/leak.c
|
@ -1,4 +1,19 @@
|
|||
#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)
|
||||
|
@ -8,6 +23,16 @@ main(void)
|
|||
|
||||
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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue