Index: testsuites/fstests/Makefile.am
===================================================================
--- testsuites/fstests/Makefile.am	(revision f78549221be6d9142263b70e246ec6adf1d58ba9)
+++ testsuites/fstests/Makefile.am	(revision 57a914a3fb2295eceff71b18f96a6a4e66542334)
@@ -15,4 +15,5 @@
 _SUBDIRS += imfs_fspermission
 _SUBDIRS += imfs_fsrdwr
+_SUBDIRS += imfs_fsscandir01
 _SUBDIRS += imfs_fssymlink
 _SUBDIRS += imfs_fstime
@@ -22,4 +23,5 @@
 _SUBDIRS += jffs2_fspermission
 _SUBDIRS += jffs2_fsrdwr
+_SUBDIRS += jffs2_fsscandir01
 _SUBDIRS += jffs2_fssymlink
 _SUBDIRS += jffs2_fstime
@@ -28,4 +30,5 @@
 _SUBDIRS += mdosfs_fsrdwr
 _SUBDIRS += mdosfs_fsstatvfs
+_SUBDIRS += mdosfs_fsscandir01
 _SUBDIRS += mdosfs_fstime
 _SUBDIRS += mimfs_fserror
@@ -34,4 +37,5 @@
 _SUBDIRS += mimfs_fspermission
 _SUBDIRS += mimfs_fsrdwr
+_SUBDIRS += mimfs_fsscandir01
 _SUBDIRS += mimfs_fssymlink
 _SUBDIRS += mimfs_fstime
@@ -42,4 +46,5 @@
 _SUBDIRS += mrfs_fspermission
 _SUBDIRS += mrfs_fsrdwr
+_SUBDIRS += mrfs_fsscandir01
 _SUBDIRS += mrfs_fssymlink
 _SUBDIRS += mrfs_fstime
Index: testsuites/fstests/configure.ac
===================================================================
--- testsuites/fstests/configure.ac	(revision f78549221be6d9142263b70e246ec6adf1d58ba9)
+++ testsuites/fstests/configure.ac	(revision 57a914a3fb2295eceff71b18f96a6a4e66542334)
@@ -91,4 +91,5 @@
 imfs_fspermission/Makefile
 imfs_fsrdwr/Makefile
+imfs_fsscandir01/Makefile
 imfs_fssymlink/Makefile
 imfs_fstime/Makefile
@@ -98,4 +99,5 @@
 jffs2_fspermission/Makefile
 jffs2_fsrdwr/Makefile
+jffs2_fsscandir01/Makefile
 jffs2_fssymlink/Makefile
 jffs2_fstime/Makefile
@@ -103,4 +105,5 @@
 mdosfs_fspatheval/Makefile
 mdosfs_fsrdwr/Makefile
+mdosfs_fsscandir01/Makefile
 mdosfs_fsstatvfs/Makefile
 mdosfs_fstime/Makefile
@@ -110,4 +113,5 @@
 mimfs_fspermission/Makefile
 mimfs_fsrdwr/Makefile
+mimfs_fsscandir01/Makefile
 mimfs_fssymlink/Makefile
 mimfs_fstime/Makefile
@@ -118,4 +122,5 @@
 mrfs_fspermission/Makefile
 mrfs_fsrdwr/Makefile
+mrfs_fsscandir01/Makefile
 mrfs_fssymlink/Makefile
 mrfs_fstime/Makefile
Index: testsuites/fstests/fsscandir01/init.c
===================================================================
--- testsuites/fstests/fsscandir01/init.c	(revision 57a914a3fb2295eceff71b18f96a6a4e66542334)
+++ testsuites/fstests/fsscandir01/init.c	(revision 57a914a3fb2295eceff71b18f96a6a4e66542334)
@@ -0,0 +1,52 @@
+/*
+ *  COPYRIGHT (c) 2015.
+ *  On-Line Applications Research Corporation (OAR).
+ *  
+ *  The license and distribution terms for this file may be
+ *  found in the file LICENSE in this distribution or at
+ *  http://www.rtems.org/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+  #include "config.h"
+#endif
+
+#include "fstest.h"
+#include "fs_config.h"
+#include "fstest_support.h"
+#include "pmacros.h"
+
+#include <dirent.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <errno.h>
+#include <limits.h>
+
+const char rtems_test_name[] = "FSSCANDIR " FILESYSTEM;
+
+/*
+ * This code is from the scandir() man page.
+ */
+static void test_scandir(void)
+{
+  struct dirent **namelist;
+  int n;
+
+  n = scandir(".", &namelist, 0, NULL);
+  if (n < 0) {
+    perror("scandir");
+  } else {
+    while(n--) {
+      printf("%s\n", namelist[n]->d_name);
+      free(namelist[n]);
+    }
+    free(namelist);
+  }
+}
+
+
+void test (void)
+{
+  test_scandir();
+}
Index: testsuites/fstests/imfs_fsscandir01/Makefile.am
===================================================================
--- testsuites/fstests/imfs_fsscandir01/Makefile.am	(revision 57a914a3fb2295eceff71b18f96a6a4e66542334)
+++ testsuites/fstests/imfs_fsscandir01/Makefile.am	(revision 57a914a3fb2295eceff71b18f96a6a4e66542334)
@@ -0,0 +1,31 @@
+
+rtems_tests_PROGRAMS = imfs_fsscandir01
+imfs_fsscandir01_SOURCES  = ../fsscandir01/init.c
+imfs_fsscandir01_SOURCES += ../support/fstest_support.c
+imfs_fsscandir01_SOURCES += ../support/fstest_support.h
+imfs_fsscandir01_SOURCES += ../support/fstest.h
+imfs_fsscandir01_SOURCES += ../../psxtests/include/pmacros.h
+imfs_fsscandir01_SOURCES += ../imfs_support/fs_support.c
+imfs_fsscandir01_SOURCES += ../imfs_support/fs_config.h 
+
+#dist_rtems_tests_DATA = imfs_fsscandir01.scn
+#dist_rtems_tests_DATA += imfs_fsscandir01.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+
+AM_CPPFLAGS += -I$(top_srcdir)/support
+AM_CPPFLAGS += -I$(top_srcdir)/imfs_support
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
+
+LINK_OBJS = $(imfs_fsscandir01_OBJECTS)
+LINK_LIBS = $(imfs_fsscandir01_LDLIBS)
+
+imfs_fsscandir01$(EXEEXT): $(imfs_fsscandir01_OBJECTS) $(imfs_fsscandir01_DEPENDENCIES)
+	@rm -f imfs_fsscandir01$(EXEEXT)
+	$(make-exe)
+
+include $(top_srcdir)/../automake/local.am
Index: testsuites/fstests/imfs_fsscandir01/imfs_fsscandir01.scn
===================================================================
--- testsuites/fstests/imfs_fsscandir01/imfs_fsscandir01.scn	(revision 57a914a3fb2295eceff71b18f96a6a4e66542334)
+++ testsuites/fstests/imfs_fsscandir01/imfs_fsscandir01.scn	(revision 57a914a3fb2295eceff71b18f96a6a4e66542334)
@@ -0,0 +1,7 @@
+*** BEGIN OF TEST FSSCANDIR ROOT IMFS ***
+Initializing filesystem ROOT IMFS
+scandir: Success
+
+
+Shutting down filesystem ROOT IMFS
+*** END OF TEST FSSCANDIR ROOT IMFS ***
Index: testsuites/fstests/jffs2_fsscandir01/Makefile.am
===================================================================
--- testsuites/fstests/jffs2_fsscandir01/Makefile.am	(revision 57a914a3fb2295eceff71b18f96a6a4e66542334)
+++ testsuites/fstests/jffs2_fsscandir01/Makefile.am	(revision 57a914a3fb2295eceff71b18f96a6a4e66542334)
@@ -0,0 +1,31 @@
+
+rtems_tests_PROGRAMS = jffs2_fsscandir01
+jffs2_fsscandir01_SOURCES  = ../fsscandir01/init.c
+jffs2_fsscandir01_SOURCES += ../support/fstest_support.c
+jffs2_fsscandir01_SOURCES += ../support/fstest_support.h
+jffs2_fsscandir01_SOURCES += ../support/fstest.h
+jffs2_fsscandir01_SOURCES += ../../psxtests/include/pmacros.h
+jffs2_fsscandir01_SOURCES += ../jffs2_support/fs_support.c
+jffs2_fsscandir01_SOURCES += ../jffs2_support/fs_config.h
+
+dist_rtems_tests_DATA = jffs2_fsscandir01.scn
+#dist_rtems_tests_DATA += jffs2_fsscandir01.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+
+AM_CPPFLAGS += -I$(top_srcdir)/support
+AM_CPPFLAGS += -I$(top_srcdir)/jffs2_support
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
+
+LINK_OBJS = $(jffs2_fsscandir01_OBJECTS)
+LINK_LIBS = $(jffs2_fsscandir01_LDLIBS)
+
+jffs2_fsscandir01$(EXEEXT): $(jffs2_fsscandir01_OBJECTS) $(jffs2_fsscandir01_DEPENDENCIES)
+	@rm -f jffs2_fsscandir01$(EXEEXT)
+	$(make-exe)
+
+include $(top_srcdir)/../automake/local.am
Index: testsuites/fstests/jffs2_fsscandir01/jffs2_fsscandir01.scn
===================================================================
--- testsuites/fstests/jffs2_fsscandir01/jffs2_fsscandir01.scn	(revision 57a914a3fb2295eceff71b18f96a6a4e66542334)
+++ testsuites/fstests/jffs2_fsscandir01/jffs2_fsscandir01.scn	(revision 57a914a3fb2295eceff71b18f96a6a4e66542334)
@@ -0,0 +1,7 @@
+*** BEGIN OF TEST FSSCANDIR JFFS2 ***
+Initializing filesystem JFFS2
+scandir: Success
+
+
+Shutting down filesystem JFFS2
+*** END OF TEST FSSCANDIR JFFS2 ***
Index: testsuites/fstests/mdosfs_fsscandir01/Makefile.am
===================================================================
--- testsuites/fstests/mdosfs_fsscandir01/Makefile.am	(revision 57a914a3fb2295eceff71b18f96a6a4e66542334)
+++ testsuites/fstests/mdosfs_fsscandir01/Makefile.am	(revision 57a914a3fb2295eceff71b18f96a6a4e66542334)
@@ -0,0 +1,33 @@
+
+rtems_tests_PROGRAMS = mdosfs_fsscandir01
+mdosfs_fsscandir01_SOURCES  = ../fsscandir01/init.c
+mdosfs_fsscandir01_SOURCES += ../support/ramdisk_support.c
+mdosfs_fsscandir01_SOURCES += ../support/fstest_support.c
+mdosfs_fsscandir01_SOURCES += ../support/fstest_support.h
+mdosfs_fsscandir01_SOURCES += ../support/ramdisk_support.h
+mdosfs_fsscandir01_SOURCES += ../support/fstest.h
+mdosfs_fsscandir01_SOURCES += ../../psxtests/include/pmacros.h
+mdosfs_fsscandir01_SOURCES += ../mdosfs_support/fs_support.c
+mdosfs_fsscandir01_SOURCES += ../mdosfs_support/fs_config.h
+
+dist_rtems_tests_DATA = mdosfs_fsscandir01.scn
+#dist_rtems_tests_DATA += mdosfs_fsscandir01.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+
+AM_CPPFLAGS += -I$(top_srcdir)/support
+AM_CPPFLAGS += -I$(top_srcdir)/mdosfs_support
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
+
+LINK_OBJS = $(mdosfs_fsscandir01_OBJECTS)
+LINK_LIBS = $(mdosfs_fsscandir01_LDLIBS)
+
+mdosfs_fsscandir01$(EXEEXT): $(mdosfs_fsscandir01_OBJECTS) $(mdosfs_fsscandir01_DEPENDENCIES)
+	@rm -f mdosfs_fsscandir01$(EXEEXT)
+	$(make-exe)
+
+include $(top_srcdir)/../automake/local.am
Index: testsuites/fstests/mdosfs_fsscandir01/mdosfs_fsscandir01.scn
===================================================================
--- testsuites/fstests/mdosfs_fsscandir01/mdosfs_fsscandir01.scn	(revision 57a914a3fb2295eceff71b18f96a6a4e66542334)
+++ testsuites/fstests/mdosfs_fsscandir01/mdosfs_fsscandir01.scn	(revision 57a914a3fb2295eceff71b18f96a6a4e66542334)
@@ -0,0 +1,6 @@
+*** BEGIN OF TEST FSSCANDIR DOSFS ***
+Initializing filesystem DOSFS
+
+
+Shutting down filesystem DOSFS
+*** END OF TEST FSSCANDIR DOSFS ***
Index: testsuites/fstests/mimfs_fsscandir01/Makefile.am
===================================================================
--- testsuites/fstests/mimfs_fsscandir01/Makefile.am	(revision 57a914a3fb2295eceff71b18f96a6a4e66542334)
+++ testsuites/fstests/mimfs_fsscandir01/Makefile.am	(revision 57a914a3fb2295eceff71b18f96a6a4e66542334)
@@ -0,0 +1,31 @@
+
+rtems_tests_PROGRAMS = mimfs_fsscandir01
+mimfs_fsscandir01_SOURCES  = ../fsscandir01/init.c
+mimfs_fsscandir01_SOURCES += ../support/fstest_support.c
+mimfs_fsscandir01_SOURCES += ../support/fstest_support.h
+mimfs_fsscandir01_SOURCES += ../support/fstest.h
+mimfs_fsscandir01_SOURCES += ../../psxtests/include/pmacros.h
+mimfs_fsscandir01_SOURCES += ../mimfs_support/fs_support.c
+mimfs_fsscandir01_SOURCES += ../mimfs_support/fs_config.h
+
+#dist_rtems_tests_DATA = mimfs_fsscandir01.scn
+#dist_rtems_tests_DATA += mimfs_fsscandir01.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+
+AM_CPPFLAGS += -I$(top_srcdir)/support
+AM_CPPFLAGS += -I$(top_srcdir)/mimfs_support
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
+
+LINK_OBJS = $(mimfs_fsscandir01_OBJECTS)
+LINK_LIBS = $(mimfs_fsscandir01_LDLIBS)
+
+mimfs_fsscandir01$(EXEEXT): $(mimfs_fsscandir01_OBJECTS) $(mimfs_fsscandir01_DEPENDENCIES)
+	@rm -f mimfs_fsscandir01$(EXEEXT)
+	$(make-exe)
+
+include $(top_srcdir)/../automake/local.am
Index: testsuites/fstests/mimfs_fsscandir01/mimfs_fsscandir01.scn
===================================================================
--- testsuites/fstests/mimfs_fsscandir01/mimfs_fsscandir01.scn	(revision 57a914a3fb2295eceff71b18f96a6a4e66542334)
+++ testsuites/fstests/mimfs_fsscandir01/mimfs_fsscandir01.scn	(revision 57a914a3fb2295eceff71b18f96a6a4e66542334)
@@ -0,0 +1,7 @@
+*** BEGIN OF TEST FSSCANDIR MOUNTED IMFS ***
+Initializing filesystem MOUNTED IMFS
+scandir: Success
+
+
+Shutting down filesystem MOUNTED IMFS
+*** END OF TEST FSSCANDIR MOUNTED IMFS ***
Index: testsuites/fstests/mrfs_fsscandir01/Makefile.am
===================================================================
--- testsuites/fstests/mrfs_fsscandir01/Makefile.am	(revision 57a914a3fb2295eceff71b18f96a6a4e66542334)
+++ testsuites/fstests/mrfs_fsscandir01/Makefile.am	(revision 57a914a3fb2295eceff71b18f96a6a4e66542334)
@@ -0,0 +1,33 @@
+
+rtems_tests_PROGRAMS = mrfs_fsscandir01
+mrfs_fsscandir01_SOURCES  = ../fsscandir01/init.c
+mrfs_fsscandir01_SOURCES += ../support/ramdisk_support.c
+mrfs_fsscandir01_SOURCES += ../support/fstest_support.c
+mrfs_fsscandir01_SOURCES += ../support/fstest_support.h
+mrfs_fsscandir01_SOURCES += ../support/ramdisk_support.h
+mrfs_fsscandir01_SOURCES += ../support/fstest.h
+mrfs_fsscandir01_SOURCES += ../../psxtests/include/pmacros.h
+mrfs_fsscandir01_SOURCES += ../mrfs_support/fs_support.c
+mrfs_fsscandir01_SOURCES += ../mrfs_support/fs_config.h
+
+dist_rtems_tests_DATA = mrfs_fsscandir01.scn
+#dist_rtems_tests_DATA += mrfs_fsscandir01.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+
+AM_CPPFLAGS += -I$(top_srcdir)/support
+AM_CPPFLAGS += -I$(top_srcdir)/mrfs_support
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
+
+LINK_OBJS = $(mrfs_fsscandir01_OBJECTS)
+LINK_LIBS = $(mrfs_fsscandir01_LDLIBS)
+
+mrfs_fsscandir01$(EXEEXT): $(mrfs_fsscandir01_OBJECTS) $(mrfs_fsscandir01_DEPENDENCIES)
+	@rm -f mrfs_fsscandir01$(EXEEXT)
+	$(make-exe)
+
+include $(top_srcdir)/../automake/local.am
Index: testsuites/fstests/mrfs_fsscandir01/mrfs_fsscandir01.scn
===================================================================
--- testsuites/fstests/mrfs_fsscandir01/mrfs_fsscandir01.scn	(revision 57a914a3fb2295eceff71b18f96a6a4e66542334)
+++ testsuites/fstests/mrfs_fsscandir01/mrfs_fsscandir01.scn	(revision 57a914a3fb2295eceff71b18f96a6a4e66542334)
@@ -0,0 +1,7 @@
+*** BEGIN OF TEST FSSCANDIR RFS ***
+Initializing filesystem RFS
+.
+
+
+Shutting down filesystem RFS
+*** END OF TEST FSSCANDIR RFS ***
