summaryrefslogtreecommitdiffstats
path: root/234/regr/spec_files/open_dir.c
blob: 81c8d7d961b5656a4cf4e9ff52e91ca7e2b9f378 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/stat.h>
#include <dirent.h>
#include <sys/types.h>
#include <fcntl.h>
#include <errno.h>

int main(int argc, char *argv[])
{
  DIR *dir;
  dir = opendir(argv[1]);
  if ( dir == NULL ) {
    return errno;
  }
  else {
    closedir(dir);
    return 0;
  }
}