change log for rtems (2011-01-17)

rtems-vc at rtems.org rtems-vc at rtems.org
Mon Jan 17 23:10:15 UTC 2011


 *joel*:
2011-01-17	Alin Rus <alin.codejunkie at gmail.com>

	* posix/src/aio_cancel.c: Fixed ending of if braces.

2011-01-17	Alin Rus <alin.codejunkie at gmail.com>

	* posix/src/aio_misc.c: Add debug information. Fixed idle_threads/
	active_threads issues. Fixed infinite loop in rtems_aio_handle().

M 1.2675  cpukit/ChangeLog
M    1.3  cpukit/libmisc/shell/main_rtc.c
M   1.14  cpukit/libmisc/shell/shell_script.c
M    1.7  cpukit/posix/src/aio_cancel.c
M    1.7  cpukit/posix/src/aio_misc.c

diff -u rtems/cpukit/ChangeLog:1.2674 rtems/cpukit/ChangeLog:1.2675
--- rtems/cpukit/ChangeLog:1.2674	Sat Jan  8 15:01:32 2011
+++ rtems/cpukit/ChangeLog	Mon Jan 17 16:12:47 2011
@@ -1,5 +1,14 @@
+2011-01-17	Alin Rus <alin.codejunkie at gmail.com>
+
+	* posix/src/aio_cancel.c: Fixed ending of if braces.
+
+2011-01-17	Alin Rus <alin.codejunkie at gmail.com>
+
+	* posix/src/aio_misc.c: Add debug information. Fixed idle_threads/
+	active_threads issues. Fixed infinite loop in rtems_aio_handle().
+
 2011-01-08	Alin Rus <alin.codejunkie at gmail.com>
-	
+
 	* posix/src/aio_misc.c: Fix rtems_aio_remove_req did not iterate
 	over chain.
 	* posix/src/aio_cancel.c: Add debug information. Add check for 

diff -u rtems/cpukit/libmisc/shell/main_rtc.c:1.2 rtems/cpukit/libmisc/shell/main_rtc.c:1.3
--- rtems/cpukit/libmisc/shell/main_rtc.c:1.2	Fri Mar 26 12:18:43 2010
+++ rtems/cpukit/libmisc/shell/main_rtc.c	Mon Jan 17 16:12:47 2011
@@ -125,7 +125,7 @@
     }
 
     if (argc > 3) {
-      rv = sscanf( argv [3], "%" PRIu32, v);
+      rv = sscanf( argv [3], "%5" PRIu32, v);
 
       if (rv == 1) {
         tod.ticks = v [0];

diff -u rtems/cpukit/libmisc/shell/shell_script.c:1.13 rtems/cpukit/libmisc/shell/shell_script.c:1.14
--- rtems/cpukit/libmisc/shell/shell_script.c:1.13	Sun Feb 28 14:14:10 2010
+++ rtems/cpukit/libmisc/shell/shell_script.c	Mon Jan 17 16:12:48 2011
@@ -46,7 +46,8 @@
 
 static int findOnPATH(
   const char *userScriptName,
-  char       *scriptFile
+  char       *scriptFile,
+  size_t      scriptFileLength
 )
 {
   int sc;
@@ -56,7 +57,7 @@
    *  qualified path name and just use it.
    */
   if ( userScriptName[0] == '/' ) {
-    strcpy( scriptFile, userScriptName );
+    strncpy( scriptFile, userScriptName, PATH_MAX );
   } else {
     /*
      *  For now, the provided name is just turned into a fully
@@ -66,11 +67,12 @@
 
     /* XXX should use strncat but what is the limit? */
     getcwd( scriptFile, PATH_MAX );
-    strcat( scriptFile, "/" );
-    strcat(
+    strncat( scriptFile, "/", PATH_MAX );
+    strncat(
       scriptFile,
       ( (userScriptName[0] == '.' && userScriptName[1] == '/') ?
-         &userScriptName[2] : userScriptName)
+         &userScriptName[2] : userScriptName),
+      PATH_MAX
     );
   }
 
@@ -187,7 +189,7 @@
    *  NOTE: It is terrible that this is done twice but it
    *        seems to be the most expedient thing.
    */
-  sc = findOnPATH( argv[getopt_reent.optind], scriptFile );
+  sc = findOnPATH( argv[getopt_reent.optind], scriptFile, PATH_MAX );
   if ( sc ) {
     fprintf( stderr, "%s: command not found\n", argv[0] );
     return -1;
@@ -258,7 +260,7 @@
   /*
    *  Find argv[0] on the path
    */
-  sc = findOnPATH( argv[0], scriptFile );
+  sc = findOnPATH( argv[0], scriptFile, PATH_MAX );
   if ( sc ) {
     fprintf( stderr, "%s: command not found\n", argv[0] );
     return -1;

diff -u rtems/cpukit/posix/src/aio_cancel.c:1.6 rtems/cpukit/posix/src/aio_cancel.c:1.7
--- rtems/cpukit/posix/src/aio_cancel.c:1.6	Sat Jan  8 15:01:32 2011
+++ rtems/cpukit/posix/src/aio_cancel.c	Mon Jan 17 16:12:48 2011
@@ -113,7 +113,7 @@
         pthread_mutex_unlock (&aio_request_queue.mutex);
         return AIO_ALLDONE;
       }
-
+    }  
       AIO_printf ("Request on [WQ]\n");
       
       pthread_mutex_lock (&r_chain->mutex);
@@ -121,7 +121,6 @@
       pthread_mutex_unlock (&r_chain->mutex);
       pthread_mutex_unlock (&aio_request_queue.mutex);
       return result;
-    }
   }
   return AIO_ALLDONE;
 }

diff -u rtems/cpukit/posix/src/aio_misc.c:1.6 rtems/cpukit/posix/src/aio_misc.c:1.7
--- rtems/cpukit/posix/src/aio_misc.c:1.6	Sat Jan  8 15:01:32 2011
+++ rtems/cpukit/posix/src/aio_misc.c	Mon Jan 17 16:12:48 2011
@@ -1,5 +1,5 @@
 /*
- * Copyright 2010, Alin Rus <alin.codejunkie at gmail.com> 
+ * Copyright 2010-2011, Alin Rus <alin.codejunkie at gmail.com> 
  * 
  * The license and distribution terms for this file may be
  * found in the file LICENSE in this distribution or at
@@ -13,6 +13,7 @@
 #include <unistd.h>
 #include <time.h>
 #include <rtems/posix/aio_misc.h>
+#include <errno.h>
 
 static void *rtems_aio_handle (void *arg);
 
@@ -123,6 +124,37 @@
   return r_chain;
 }
 
+/*
+ *  rtems_aio_move_to_work 
+ * 
+ * Move chain of requests from IQ to WQ
+ *
+ *  Input parameters:
+ *        r_chain      - chain of requests
+ *
+ *  Output paramteres:
+ *        NONE
+ */
+
+void
+rtems_aio_move_to_work (rtems_aio_request_chain *r_chain)
+{
+  rtems_aio_request_chain *temp;
+  rtems_chain_node *node;
+  
+  node = rtems_chain_first (&aio_request_queue.work_req);
+  temp = (rtems_aio_request_chain *) node;
+
+  while (temp->fildes < r_chain->fildes && 
+	 !rtems_chain_is_tail (&aio_request_queue.work_req, node)) {
+    node = rtems_chain_next (node);
+    temp = (rtems_aio_request_chain *) node;
+  }
+  
+  rtems_chain_insert (rtems_chain_previous (node), &r_chain->next_fd);
+}
+ 
+
 /* 
  *  rtems_aio_insert_prio
  *
@@ -291,7 +323,7 @@
 	r_chain->new_fd = 0;
 	pthread_mutex_init (&r_chain->mutex, NULL);
 	pthread_cond_init (&r_chain->cond, NULL);
-	
+	    
 	AIO_printf ("New thread \n");
 	result = pthread_create (&thid, &aio_request_queue.attr,
 				 rtems_aio_handle, (void *) r_chain);
@@ -337,11 +369,11 @@
 	  r_chain->new_fd = 0;
 	  pthread_mutex_init (&r_chain->mutex, NULL);
 	  pthread_cond_init (&r_chain->cond, NULL);
-	  pthread_cond_signal (&aio_request_queue.new_req);
-	  ++aio_request_queue.idle_threads;
 	} else
 	  /* just insert the request in the existing fd chain */
 	  rtems_aio_insert_prio (&r_chain->perfd, req);
+	if (aio_request_queue.idle_threads > 0)
+	  pthread_cond_signal (&aio_request_queue.new_req);
       }
     }
 
@@ -385,7 +417,7 @@
     if (result != 0)
       return NULL;
     
-    chain = &r_chain->perfd;
+    chain = &r_chain->perfd;    
 
     /* If the locked chain is not empty, take the first
        request extract it, unlock the chain and process 
@@ -393,6 +425,7 @@
        requests to this fd chain */
     if (!rtems_chain_is_empty (chain)) {
 
+      AIO_printf ("Get new request from not empty chain\n");	
       node = rtems_chain_first (chain);
       req = (rtems_aio_request *) node;
       
@@ -408,18 +441,21 @@
 
       switch (req->aiocbp->aio_lio_opcode) {
       case LIO_READ:
+	AIO_printf ("read\n");
         result = pread (req->aiocbp->aio_fildes,
                         (void *) req->aiocbp->aio_buf,
                         req->aiocbp->aio_nbytes, req->aiocbp->aio_offset);
         break;
 
       case LIO_WRITE:
+	AIO_printf ("write\n");
         result = pwrite (req->aiocbp->aio_fildes,
                          (void *) req->aiocbp->aio_buf,
                          req->aiocbp->aio_nbytes, req->aiocbp->aio_offset);
         break;
         
       case LIO_SYNC:
+	AIO_printf ("sync\n");
       	result = fsync (req->aiocbp->aio_fildes);
       	break;
 
@@ -445,19 +481,23 @@
 	 If there was no request added sleep for 3 seconds and
 	 wait for a signal on chain, this will unlock the queue.
 	 The fd chain is already unlocked */
-      
+
       struct timespec timeout;
+      
+      AIO_printf ("Chain is empty [WQ], wait for work\n");
      
       pthread_mutex_unlock (&r_chain->mutex);
       pthread_mutex_lock (&aio_request_queue.mutex);
+      
       if (rtems_chain_is_empty (chain))
 	{
 	  clock_gettime (CLOCK_REALTIME, &timeout);
 	  timeout.tv_sec += 3;
 	  timeout.tv_nsec = 0;
 	  result = pthread_cond_timedwait (&r_chain->cond,
-					   &aio_request_queue.mutex, &timeout);
-	  
+					   &aio_request_queue.mutex,
+					   &timeout);
+
 	  /* If no requests were added to the chain we delete the fd chain from 
 	     the queue and start working with idle fd chains */
 	  if (result == ETIMEDOUT) {
@@ -469,10 +509,14 @@
 	    /* If the idle chain is empty sleep for 3 seconds and wait for a 
 	       signal. The thread now becomes idle. */
 	    if (rtems_chain_is_empty (&aio_request_queue.idle_req)) {
+	      AIO_printf ("Chain is empty [IQ], wait for work\n");	      
+
 	      ++aio_request_queue.idle_threads;
+	      --aio_request_queue.active_threads;
 	      clock_gettime (CLOCK_REALTIME, &timeout);
 	      timeout.tv_sec += 3;
 	      timeout.tv_nsec = 0;
+
 	      result = pthread_cond_timedwait (&aio_request_queue.new_req,
 					       &aio_request_queue.mutex,
 					       &timeout);
@@ -480,34 +524,33 @@
 	      /* If no new fd chain was added in the idle requests
 		 then this thread is finished */
 	      if (result == ETIMEDOUT) {
+		AIO_printf ("Etimeout\n");
+		--aio_request_queue.idle_threads;
 		pthread_mutex_unlock (&aio_request_queue.mutex);
 		return NULL;
 	      }
-	      
-	      /* Otherwise move this chain to the working chain and 
-		 start the loop all over again */
-	      --aio_request_queue.idle_threads;
-	      node = rtems_chain_first (&aio_request_queue.idle_req);
-	      rtems_chain_extract (node);
-	      r_chain = rtems_aio_search_fd (&aio_request_queue.work_req,
-					     ((rtems_aio_request_chain *)node)->fildes,
-					     1);
-	      r_chain->new_fd = 0;
-	      pthread_mutex_init (&r_chain->mutex, NULL);
-	      pthread_cond_init (&r_chain->cond, NULL);
-	      
-	      r_chain->perfd = ((rtems_aio_request_chain *)node)->perfd;
 	    }
-	    else
-	      /* If there was a request added in the initial fd chain then release
-		 the mutex and process it */
-	      pthread_mutex_unlock (&aio_request_queue.mutex);
+	    /* Otherwise move this chain to the working chain and 
+	       start the loop all over again */
+	    AIO_printf ("Work on idle\n");
+	    --aio_request_queue.idle_threads;
+	    ++aio_request_queue.active_threads;
+
+	    node = rtems_chain_first (&aio_request_queue.idle_req);
+	    rtems_chain_extract (node);
+
+	    r_chain = (rtems_aio_request_chain *) node;
+	    rtems_aio_move_to_work (r_chain);
+	    
 	  }
 	}
+      /* If there was a request added in the initial fd chain then release
+	 the mutex and process it */
+      pthread_mutex_unlock (&aio_request_queue.mutex);
+      
     }
   }
   
-
   AIO_printf ("Thread finished\n");
   return NULL;
 }


 *joel*:
2011-01-17	Alin Rus <alin.codejunkie at gmail.com>

	* Makefile.am, configure.ac: Add psxaio03/.
	* psxaio03/Makefile.am, psxaio03/init.c, psxaio03/psxaio03.scn
	psxaio03/system.h: New.

M  1.327  testsuites/psxtests/ChangeLog
M   1.73  testsuites/psxtests/Makefile.am
M   1.79  testsuites/psxtests/configure.ac
A    1.1  testsuites/psxtests/psxaio03/.cvsignore
A    1.1  testsuites/psxtests/psxaio03/Makefile.am
A    1.1  testsuites/psxtests/psxaio03/Makefile.in
A    1.1  testsuites/psxtests/psxaio03/init.c
A    1.1  testsuites/psxtests/psxaio03/psxaio03.scn
A    1.1  testsuites/psxtests/psxaio03/system.h

diff -u rtems/testsuites/psxtests/ChangeLog:1.326 rtems/testsuites/psxtests/ChangeLog:1.327
--- rtems/testsuites/psxtests/ChangeLog:1.326	Sat Jan  8 15:01:47 2011
+++ rtems/testsuites/psxtests/ChangeLog	Mon Jan 17 16:17:18 2011
@@ -1,3 +1,9 @@
+2011-01-17	Alin Rus <alin.codejunkie at gmail.com>
+
+	* Makefile.am, configure.ac: Add psxaio03/. 
+	* psxaio03/Makefile.am, psxaio03/init.c, psxaio03/psxaio03.scn
+	psxaio03/system.h: New.
+
 2011-01-08	Alin Rus <alin.codejunkie at gmail.com>
 
 	* psxaio02/init.c: Improve aio_cancel() coverage.

diff -u rtems/testsuites/psxtests/Makefile.am:1.72 rtems/testsuites/psxtests/Makefile.am:1.73
--- rtems/testsuites/psxtests/Makefile.am:1.72	Thu Oct 21 17:05:17 2010
+++ rtems/testsuites/psxtests/Makefile.am	Mon Jan 17 16:17:18 2011
@@ -7,8 +7,8 @@
 SUBDIRS = psxclock
 if HAS_POSIX
 SUBDIRS += psxhdrs psx01 psx02 psx03 psx04 psx05 psx06 psx07 psx08 psx09 \
-    psx10 psx11 psx12 psx13 psx14 psx15 psxaio01 psxaio02 psxalarm01 \
-    psxautoinit01 psxautoinit02 psxbarrier01 \
+    psx10 psx11 psx12 psx13 psx14 psx15 psxaio01 psxaio02 psxaio03 \
+    psxalarm01 psxautoinit01 psxautoinit02 psxbarrier01 \
     psxcancel psxcancel01 psxcleanup psxcleanup01 \
     psxcond01 psxenosys psxkey01 psxkey02 psxkey03 \
     psxitimer psxmsgq01 psxmsgq02 psxmsgq03 psxmsgq04 \

diff -u rtems/testsuites/psxtests/configure.ac:1.78 rtems/testsuites/psxtests/configure.ac:1.79
--- rtems/testsuites/psxtests/configure.ac:1.78	Thu Oct 21 17:05:17 2010
+++ rtems/testsuites/psxtests/configure.ac	Mon Jan 17 16:17:18 2011
@@ -95,6 +95,7 @@
 psx15/Makefile
 psxaio01/Makefile
 psxaio02/Makefile
+psxaio03/Makefile
 psxalarm01/Makefile
 psxautoinit01/Makefile
 psxautoinit02/Makefile

diff -u /dev/null rtems/testsuites/psxtests/psxaio03/.cvsignore:1.1
--- /dev/null	Mon Jan 17 17:10:15 2011
+++ rtems/testsuites/psxtests/psxaio03/.cvsignore	Mon Jan 17 16:17:18 2011
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in

diff -u /dev/null rtems/testsuites/psxtests/psxaio03/Makefile.am:1.1
--- /dev/null	Mon Jan 17 17:10:15 2011
+++ rtems/testsuites/psxtests/psxaio03/Makefile.am	Mon Jan 17 16:17:18 2011
@@ -0,0 +1,25 @@
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = psxaio03
+psxaio03_SOURCES = init.c system.h ../include/pmacros.h
+
+dist_rtems_tests_DATA = psxaio03.scn
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+psxaio03_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/include
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+
+LINK_OBJS = $(psxaio03_OBJECTS) $(psxaio03_LDADD)
+LINK_LIBS = $(psxaio02_LDLIBS)
+
+psxaio03$(EXEEXT): $(psxaio03_OBJECTS) $(psxaio03_DEPENDENCIES)
+	@rm -f psxaio03$(EXEEXT)
+	$(make-exe)
+
+include $(top_srcdir)/../automake/local.am
\ No newline at end of file

diff -u /dev/null rtems/testsuites/psxtests/psxaio03/Makefile.in:1.1
--- /dev/null	Mon Jan 17 17:10:15 2011
+++ rtems/testsuites/psxtests/psxaio03/Makefile.in	Mon Jan 17 16:17:18 2011
@@ -0,0 +1,577 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+rtems_tests_PROGRAMS = psxaio03$(EXEEXT)
+DIST_COMMON = $(dist_rtems_tests_DATA) $(srcdir)/Makefile.am \
+	$(srcdir)/Makefile.in $(top_srcdir)/../automake/compile.am \
+	$(top_srcdir)/../automake/leaf.am \
+	$(top_srcdir)/../automake/local.am
+subdir = psxaio03
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps =  \
+	$(top_srcdir)/../aclocal/canonical-target-name.m4 \
+	$(top_srcdir)/../aclocal/canonicalize-tools.m4 \
+	$(top_srcdir)/../aclocal/check-cpuopts.m4 \
+	$(top_srcdir)/../aclocal/check-custom-bsp.m4 \
+	$(top_srcdir)/../aclocal/check-tool.m4 \
+	$(top_srcdir)/../aclocal/env-rtemsbsp.m4 \
+	$(top_srcdir)/../aclocal/prog-cc.m4 \
+	$(top_srcdir)/../aclocal/project-root.m4 \
+	$(top_srcdir)/../aclocal/rtems-top.m4 \
+	$(top_srcdir)/../aclocal/version.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(rtems_testsdir)" \
+	"$(DESTDIR)$(rtems_testsdir)"
+PROGRAMS = $(rtems_tests_PROGRAMS)
+am_psxaio03_OBJECTS = init.$(OBJEXT)
+psxaio03_OBJECTS = $(am_psxaio03_OBJECTS)
+psxaio03_DEPENDENCIES =  \
+	$(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+DEFAULT_INCLUDES = -I. at am__isrc@
+depcomp = $(SHELL) $(top_srcdir)/../../depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(psxaio03_SOURCES)
+DIST_SOURCES = $(psxaio03_SOURCES)
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+DATA = $(dist_rtems_tests_DATA)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AS = @AS@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BIN2C = @BIN2C@
+CC = @CC@ $(GCCSPECS)
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@ $(GCCSPECS)
+CPPFLAGS = @CPPFLAGS@
+CPUKIT_ROOT = @CPUKIT_ROOT@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+ENDIF = @ENDIF@
+EXEEXT = @EXEEXT@
+GCCSPECS = @GCCSPECS@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKE = @MAKE@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+OBJCOPY = @OBJCOPY@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PACKHEX = @PACKHEX@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PROJECT_INCLUDE = @PROJECT_INCLUDE@
+PROJECT_LIB = @PROJECT_LIB@
+PROJECT_RELEASE = @PROJECT_RELEASE@
+PROJECT_ROOT = @PROJECT_ROOT@
+PROJECT_TOPdir = @PROJECT_TOPdir@
+RANLIB = @RANLIB@
+RTEMS_BSP = @RTEMS_BSP@
+RTEMS_BSP_FAMILY = @RTEMS_BSP_FAMILY@
+RTEMS_CPU = @RTEMS_CPU@
+RTEMS_ROOT = @RTEMS_ROOT@
+RTEMS_TOPdir = @RTEMS_TOPdir@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SIZE = @SIZE@
+STRIP = @STRIP@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+rtems_testsdir = @rtems_testsdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+MANAGERS = all
+psxaio03_SOURCES = init.c system.h ../include/pmacros.h
+dist_rtems_tests_DATA = psxaio03.scn
+CXX = @CXX@ $(GCCSPECS)
+AM_CPPFLAGS = -I$(top_srcdir)/include \
+	-I$(top_srcdir)/../support/include
+AM_CFLAGS = 
+AM_CXXFLAGS = 
+CLEANFILES = *.num *.nxe *.elf *.srec* *.bin *.bt *.ralf
+CXXLINK_APP = $(CXXLINK) $(LDLIBS) $(LINK_OBJS) $(LINK_LIBS)
+LINK_APP = $(LINK) $(LDLIBS) $(LINK_OBJS) $(LINK_LIBS)
+psxaio03_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+LINK_OBJS = $(psxaio03_OBJECTS) $(psxaio03_LDADD)
+LINK_LIBS = $(psxaio02_LDLIBS)
+PROJECT_TOOLS = $(PROJECT_RELEASE)/build-tools
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/../automake/compile.am $(top_srcdir)/../automake/leaf.am $(top_srcdir)/../automake/local.am $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign psxaio03/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign psxaio03/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-rtems_testsPROGRAMS: $(rtems_tests_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	test -z "$(rtems_testsdir)" || $(MKDIR_P) "$(DESTDIR)$(rtems_testsdir)"
+	@list='$(rtems_tests_PROGRAMS)'; test -n "$(rtems_testsdir)" || list=; \
+	for p in $$list; do echo "$$p $$p"; done | \
+	sed 's/$(EXEEXT)$$//' | \
+	while read p p1; do if test -f $$p; \
+	  then echo "$$p"; echo "$$p"; else :; fi; \
+	done | \
+	sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+	    -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+	sed 'N;N;N;s,\n, ,g' | \
+	$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+	  { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+	    if ($$2 == $$4) files[d] = files[d] " " $$1; \
+	    else { print "f", $$3 "/" $$4, $$1; } } \
+	  END { for (d in files) print "f", d, files[d] }' | \
+	while read type dir files; do \
+	    if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+	    test -z "$$files" || { \
+	      echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(rtems_testsdir)$$dir'"; \
+	      $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(rtems_testsdir)$$dir" || exit $$?; \
+	    } \
+	; done
+
+uninstall-rtems_testsPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(rtems_tests_PROGRAMS)'; test -n "$(rtems_testsdir)" || list=; \
+	files=`for p in $$list; do echo "$$p"; done | \
+	  sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+	      -e 's/$$/$(EXEEXT)/' `; \
+	test -n "$$list" || exit 0; \
+	echo " ( cd '$(DESTDIR)$(rtems_testsdir)' && rm -f" $$files ")"; \
+	cd "$(DESTDIR)$(rtems_testsdir)" && rm -f $$files
+
+clean-rtems_testsPROGRAMS:
+	-test -z "$(rtems_tests_PROGRAMS)" || rm -f $(rtems_tests_PROGRAMS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/init.Po at am__quote@
+
+.c.o:
+ at am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(COMPILE) -c $<
+
+.c.obj:
+ at am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`
+install-dist_rtems_testsDATA: $(dist_rtems_tests_DATA)
+	@$(NORMAL_INSTALL)
+	test -z "$(rtems_testsdir)" || $(MKDIR_P) "$(DESTDIR)$(rtems_testsdir)"
+	@list='$(dist_rtems_tests_DATA)'; test -n "$(rtems_testsdir)" || list=; \
+	for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  echo "$$d$$p"; \
+	done | $(am__base_list) | \
+	while read files; do \
+	  echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(rtems_testsdir)'"; \
+	  $(INSTALL_DATA) $$files "$(DESTDIR)$(rtems_testsdir)" || exit $$?; \
+	done
+
+uninstall-dist_rtems_testsDATA:
+	@$(NORMAL_UNINSTALL)
+	@list='$(dist_rtems_tests_DATA)'; test -n "$(rtems_testsdir)" || list=; \
+	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+	test -n "$$files" || exit 0; \
+	echo " ( cd '$(DESTDIR)$(rtems_testsdir)' && rm -f" $$files ")"; \
+	cd "$(DESTDIR)$(rtems_testsdir)" && rm -f $$files
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS) $(DATA)
+installdirs:
+	for dir in "$(DESTDIR)$(rtems_testsdir)" "$(DESTDIR)$(rtems_testsdir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-rtems_testsPROGRAMS mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-dist_rtems_testsDATA \
+	install-rtems_testsPROGRAMS
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-dist_rtems_testsDATA \
+	uninstall-rtems_testsPROGRAMS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-rtems_testsPROGRAMS ctags distclean distclean-compile \
+	distclean-generic distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dist_rtems_testsDATA install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-rtems_testsPROGRAMS install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
+	uninstall-am uninstall-dist_rtems_testsDATA \
+	uninstall-rtems_testsPROGRAMS
+
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(RTEMS_ROOT)/make/leaf.cfg
+ifndef make-cxx-exe
+define make-cxx-exe
+	$(CXXLINK_APP)
+endef
+ at ENDIF@
+ifndef make-exe
+define make-exe
+	$(LINK_APP)
+endef
+ at ENDIF@
+
+psxaio03$(EXEEXT): $(psxaio03_OBJECTS) $(psxaio03_DEPENDENCIES)
+	@rm -f psxaio03$(EXEEXT)
+	$(make-exe)
+
+preinstall:
+.PHONY: preinstall
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:

diff -u /dev/null rtems/testsuites/psxtests/psxaio03/init.c:1.1
--- /dev/null	Mon Jan 17 17:10:15 2011
+++ rtems/testsuites/psxtests/psxaio03/init.c	Mon Jan 17 16:17:18 2011
@@ -0,0 +1,136 @@
+/*
+ * Copyright 2011, Alin Rus <alin.codejunkie at gmail.com>
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ *
+ */
+
+#define CONFIGURE_INIT
+#include "system.h"
+#include <rtems.h>
+#include "tmacros.h"
+#include <rtems/posix/aio_misc.h>
+#include <aio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <sched.h>
+#include <fcntl.h>
+#include <rtems/chain.h>
+
+#define MAX 6
+#define BUFSIZE 128
+
+struct aiocb *
+create_aiocb (int fd)
+{
+  struct aiocb *aiocbp;
+
+  aiocbp = malloc (sizeof (struct aiocb));
+  memset (aiocbp, 0, sizeof (struct aiocb));
+  aiocbp->aio_buf = malloc (BUFSIZE * sizeof (char));
+  aiocbp->aio_nbytes = BUFSIZE;
+  aiocbp->aio_offset = 0;
+  aiocbp->aio_reqprio = 0;
+  aiocbp->aio_fildes = fd;
+
+  return aiocbp;
+}
+
+void
+free_aiocb (struct aiocb *aiocbp)
+{
+  free ((char*) aiocbp->aio_buf);
+  free (aiocbp);
+}
+
+
+void *
+POSIX_Init (void *argument)
+{
+  int fd[MAX];
+  struct aiocb *aiocbp[MAX+1];
+  int status, i, policy = SCHED_FIFO;
+  char filename[BUFSIZE];
+  struct sched_param param;
+
+  status = rtems_aio_init ();
+  rtems_test_assert (status == 0);
+
+  param.sched_priority = 30;
+  status = pthread_setschedparam (pthread_self(), policy, &param);
+  rtems_test_assert (status == 0);
+
+  status = mkdir ("/tmp", S_IRWXU);
+  rtems_test_assert (!status);
+
+  puts ("\n\n*** POSIX AIO TEST 03 ***");
+
+  puts (" Init: Open files ");
+
+  for (i=0; i<MAX; i++)
+    {
+      sprintf (filename, "/tmp/aio_fildes%d",i);
+      fd[i] = open (filename, O_RDWR|O_CREAT, S_IRWXU|S_IRWXG|S_IRWXO);
+      rtems_test_assert ( fd[i] != -1);
+    }
+  
+  puts (" Init: [WQ] aio_write on 1st file ");
+  aiocbp[0] = create_aiocb (fd[0]);
+  status = aio_write (aiocbp[0]);
+  rtems_test_assert (status != -1);
+  
+  puts (" Init: [WQ] aio_write on 2nd file ");
+  aiocbp[1] = create_aiocb (fd[1]);
+  status = aio_write (aiocbp[1]);
+  rtems_test_assert (status != -1);
+
+  puts (" Init: [WQ] aio_read on 2nd file add by priority ");
+  aiocbp[2] = create_aiocb (fd[1]);
+  status = aio_read (aiocbp[2]);
+  rtems_test_assert (status != -1);
+  
+  puts (" Init: [WQ] aio_write on 3rd file ");
+  aiocbp[3] = create_aiocb (fd[2]);
+  status = aio_write (aiocbp[3]);
+  rtems_test_assert (status != -1);
+  
+  puts (" Init: [WQ] aio_write on 4th file ");
+  aiocbp[4] = create_aiocb (fd[3]);
+  status = aio_write (aiocbp[4]);
+  rtems_test_assert (status != -1);
+ 
+  puts (" Init: [WQ] aio_write on 5th file  -- [WQ] full ");
+  aiocbp[5] = create_aiocb (fd[4]);
+  status = aio_write (aiocbp[5]);
+  rtems_test_assert (status != -1);
+
+  puts (" Init: [IQ] aio_write on 6th file ");
+  aiocbp[6] = create_aiocb (fd[5]);
+  status = aio_read (aiocbp[6]);
+  rtems_test_assert (status != -1);
+ 
+  puts (" Init: going to sleep for 60 sec ");
+  sleep (60);
+  puts (" Init: going to sleep again for 60 sec ");
+  sleep (60);
+  puts (" Init: going to sleep again for 60 sec ");
+  sleep (60);
+  puts ("\n\n*** POSIX AIO TEST 03 ***");
+  
+  puts ("*** END OF POSIX AIO TEST 03 ***");
+  
+  for (i = 0; i < MAX; i++)
+    {
+      close (fd[i]);
+      free_aiocb (aiocbp[i]);
+    }
+  free_aiocb (aiocbp[i]);
+  rtems_test_exit (0);
+  
+  return NULL;
+  
+}
+

diff -u /dev/null rtems/testsuites/psxtests/psxaio03/system.h:1.1
--- /dev/null	Mon Jan 17 17:10:15 2011
+++ rtems/testsuites/psxtests/psxaio03/system.h	Mon Jan 17 16:17:18 2011
@@ -0,0 +1,47 @@
+ /*
+  * Copyright 2011, Alin Rus <alin.codejunkie at gmail.com>
+  *
+  * The license and distribution terms for this file may be
+  * found in the file LICENSE in this distribution or at
+  * http://www.rtems.com/license/LICENSE.
+  *
+  */
+
+/* functions */
+
+#include <pmacros.h>
+#include <pthread.h>
+#include <errno.h>
+#include <sched.h>
+
+void *POSIX_Init (void *argument);
+
+/* configuration information */
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
+#define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM
+
+#define CONFIGURE_MAXIMUM_TASKS             20
+#define CONFIGURE_MAXIMUM_SEMAPHORES        20
+#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES    20
+#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 20
+#define CONFIGURE_STACK_CHECKER_ENABLED
+
+#define CONFIGURE_MAXIMUM_POSIX_THREADS        30
+#define CONFIGURE_MAXIMUM_POSIX_MUTEXES        30
+#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES     30
+#define CONFIGURE_MAXIMUM_POSIX_KEYS           30
+
+#define CONFIGURE_POSIX_INIT_THREAD_TABLE
+#define CONFIGURE_EXTRA_TASK_STACKS         (10 * RTEMS_MINIMUM_STACK_SIZE)
+#define CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE (10 * RTEMS_MINIMUM_STACK_SIZE)
+
+#define CONFIGURE_MALLOC_STATISTICS
+
+#include <rtems/confdefs.h>
+
+/* global variables */
+TEST_EXTERN pthread_t Init_id;
+
+/* end of include file */


 *joel*:
2011-01-17	Joel Sherrill <joel.sherrill at oarcorp.com>

	* libmisc/shell/main_dd.c: Make symbol unique to avoid conflict with
	same name in <sys/stat.h>.

M 1.2676  cpukit/ChangeLog
M    1.5  cpukit/libmisc/shell/main_dd.c

diff -u rtems/cpukit/ChangeLog:1.2675 rtems/cpukit/ChangeLog:1.2676
--- rtems/cpukit/ChangeLog:1.2675	Mon Jan 17 16:12:47 2011
+++ rtems/cpukit/ChangeLog	Mon Jan 17 17:05:36 2011
@@ -1,3 +1,8 @@
+2011-01-17	Joel Sherrill <joel.sherrill at oarcorp.com>
+
+	* libmisc/shell/main_dd.c: Make symbol unique to avoid conflict with
+	same name in <sys/stat.h>.
+
 2011-01-17	Alin Rus <alin.codejunkie at gmail.com>
 
 	* posix/src/aio_cancel.c: Fixed ending of if braces.

diff -u rtems/cpukit/libmisc/shell/main_dd.c:1.4 rtems/cpukit/libmisc/shell/main_dd.c:1.5
--- rtems/cpukit/libmisc/shell/main_dd.c:1.4	Fri Mar 26 12:18:43 2010
+++ rtems/cpukit/libmisc/shell/main_dd.c	Mon Jan 17 17:05:36 2011
@@ -76,7 +76,7 @@
 #include "dd.h"
 #include "extern-dd.h"
 
-#define DEFFILEMODE 0
+#define DD_DEFFILEMODE 0
 
 static void dd_close(rtems_shell_dd_globals* globals);
 static void dd_in(rtems_shell_dd_globals* globals);
@@ -194,14 +194,14 @@
 	} else {
 #define	OFLAGS \
     (O_CREAT | (ddflags & (C_SEEK | C_NOTRUNC) ? 0 : O_TRUNC))
-		out.fd = open(out.name, O_RDWR | OFLAGS, DEFFILEMODE);
+		out.fd = open(out.name, O_RDWR | OFLAGS, DD_DEFFILEMODE);
 		/*
 		 * May not have read access, so try again with write only.
 		 * Without read we may have a problem if output also does
 		 * not support seeks.
 		 */
 		if (out.fd == -1) {
-			out.fd = open(out.name, O_WRONLY | OFLAGS, DEFFILEMODE);
+			out.fd = open(out.name, O_WRONLY | OFLAGS, DD_DEFFILEMODE);
 			out.flags |= NOREAD;
 		}
 		if (out.fd == -1)



--

Generated by Deluxe Loginfo [http://www.codewiz.org/projects/index.html#loginfo] 2.122 by Bernardo Innocenti <bernie at develer.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/vc/attachments/20110117/49a5248b/attachment-0001.html>


More information about the vc mailing list