projects
/
libc-test
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
6419e937f630c2635ba9f34fb21c2ead23f045c5
[libc-test]
/
src
/
common
/
fdfill.c
1
#include <fcntl.h>
2
#include <unistd.h>
3
#include <errno.h>
4
#include "test.h"
5
6
void t_fdfill(void)
7
{
8
int fd = 1;
9
if (dup(fd) == -1) {
10
if (errno == EMFILE)
11
return;
12
fd = open("/dev/null", O_RDONLY);
13
}
14
while(dup(fd) != -1);
15
}