aboutsummaryrefslogtreecommitdiffstats
path: root/CWRU/misc/open-files.c
blob: 8f4d18e5f8ab626dc10d447b9343d66b4d05f77f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <sys/types.h>
#include <fcntl.h>
#include <sys/file.h>
#include <stdio.h>

main()
{
	register int	i;

	for (i = 0; i < getdtablesize(); i++) {
		if (fcntl(i, F_GETFD, 0) != -1)
			fprintf(stderr, "fd %d: open\n", i);
	}
	exit(0);
}