1
0
mirror of https://github.com/ioacademy-jikim/debugging synced 2025-06-08 08:26:14 +00:00
2015-12-13 22:34:58 +09:00

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