allwinner_a64/android/external/valgrind/none/tests/closeall.c
2018-08-08 16:14:42 +08:00

17 lines
264 B
C

#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 );
}