blob: 39ca3e4201de43db92e2432241193a6fa2a8ca57 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
/* ==== test_readdir.c ========================================================
* Copyright (c) 1993, 1994 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 <pthread.h>
#include <sys/types.h>
#include <dirent.h>
#include <stdio.h>
#include "test.h"
int
main()
{
struct dirent * file;
DIR * dot_dir;
int found = 0;
CHECKen(dot_dir = opendir("."));
while ((file = readdir(dot_dir)) != NULL)
if (strcmp("test_readdir", file->d_name) == 0)
found = 1;
CHECKe(closedir(dot_dir));
ASSERT(found);
SUCCEED;
}
|