Gitiles
Code Review
Sign In
gerrit-public.fairphone.software
/
platform
/
external
/
valgrind
/
1d0cb0d000768c01536d61cbb0a2d6e8a9af52eb
/
.
/
none
/
tests
/
closeall.c
blob: facf6a580c2974946d2ef58563b2d4cbc7a3113b [
file
] [
log
] [
blame
]
#include
<stdio.h>
#include
<stdlib.h>
#include
<sys/resource.h>
#include
<unistd.h>
int
main
(
int
argc
,
char
**
argv
)
{
struct
rlimit lim
;
int
fd
;
getrlimit
(
RLIMIT_NOFILE
,
&
lim
);
for
(
fd
=
3
;
fd
<
lim
.
rlim_cur
;
fd
++
)
close
(
fd
);
exit
(
0
);
}