repo.or.cz
/
valgrind.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
none/tests/fdleak_cmsg_supp.supp: Add suppressions for older glibc
[valgrind.git]
/
none
/
tests
/
closeall.c
blob
e153d47850ed0e968967d734540310980a01a8b8
1
#include <stdio.h>
2
#include <stdlib.h>
3
#include <sys/types.h>
4
#include <sys/time.h>
5
#include <sys/resource.h>
6
#include <unistd.h>
7
8
int
main
(
int
argc
,
char
**
argv
)
9
{
10
struct
rlimit lim
;
11
int
fd
;
12
13
getrlimit
(
RLIMIT_NOFILE
, &
lim
);
14
15
for
(
fd
=
3
;
fd
<
lim
.
rlim_cur
;
fd
++ )
16
close
(
fd
);
17
18
exit
(
0
);
19
}