/* ==== test_readdir.c ========================================================
 * Copyright (c) 1993 by Chris Provenzano, proven@athena.mit.edu
 *
 * Description : Test pthread_create() and pthread_exit() calls.
 *
 *  1.00 94/05/19 proven
 *      -Started coding this file.
 */

#include <sys/types.h>
#include <pthread.h>
#include <dirent.h>
#include <stdio.h>

main()
{
	struct dirent * file;
	DIR * dot_dir;
	int i;

	pthread_init(); 

	if (dot_dir = opendir(".")) {
		while (file = readdir(dot_dir)) {
			if (!strcmp("test_readdir", file->d_name)) {
				printf("Found file test_readdir\n");
				closedir(dot_dir);
				exit(0);
			}
		}
		printf("Error: Couldn't find file test_readdir\n");
	} else {
		printf("Error: Couldn't open . directory\n");
	}
	exit(1);
}
