Sign in
ara-mdk
/
platform
/
external
/
valgrind
/
0d909f54d46a5c4e5143a0469f77472673fdd06a
/
.
/
main
/
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
);
}