<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>change log for rtems (2010-11-01)</title>
</head>
<body text='#000000' bgcolor='#ffffff'>
<a name='cs1'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
 <font color='#bb2222'><strong>joel</strong></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>2010-11-01 Alin Rus <alin.codejunkie@gmail.com>

        * posix/include/rtems/posix/aio_misc.h, posix/src/aio_misc.c: Small
        fixes.
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/ChangeLog.diff?r1=text&tr1=1.2639&r2=text&tr2=1.2640&diff_format=h">M</a></td><td width='1%'>1.2640</td><td width='100%'>cpukit/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/posix/include/rtems/posix/aio_misc.h.diff?r1=text&tr1=1.5&r2=text&tr2=1.6&diff_format=h">M</a></td><td width='1%'>1.6</td><td width='100%'>cpukit/posix/include/rtems/posix/aio_misc.h</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/posix/src/aio_misc.c.diff?r1=text&tr1=1.4&r2=text&tr2=1.5&diff_format=h">M</a></td><td width='1%'>1.5</td><td width='100%'>cpukit/posix/src/aio_misc.c</td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/cpukit/ChangeLog:1.2639 rtems/cpukit/ChangeLog:1.2640
--- rtems/cpukit/ChangeLog:1.2639       Thu Oct 21 17:27:16 2010
+++ rtems/cpukit/ChangeLog      Mon Nov  1 12:32:52 2010
</font><font color='#997700'>@@ -1,3 +1,8 @@
</font><font color='#000088'>+2010-11-01    Alin Rus <alin.codejunkie@gmail.com>
+
+       * posix/include/rtems/posix/aio_misc.h, posix/src/aio_misc.c: Small
+       fixes.
+
</font> 2010-10-21        Joel Sherrill <joel.sherrill@oarcorp.com>
 
        * posix/src/psignalunblockthread.c: Formatting.

<font color='#006600'>diff -u rtems/cpukit/posix/include/rtems/posix/aio_misc.h:1.5 rtems/cpukit/posix/include/rtems/posix/aio_misc.h:1.6
--- rtems/cpukit/posix/include/rtems/posix/aio_misc.h:1.5       Fri Aug 20 09:37:08 2010
+++ rtems/cpukit/posix/include/rtems/posix/aio_misc.h   Mon Nov  1 12:32:53 2010
</font><font color='#997700'>@@ -29,20 +29,20 @@
</font>   /* Actual request being processed */
   typedef struct
   {
<font color='#000088'>+    rtems_chain_node next_prio; /* chain requests in order of priority */
</font>     int policy;                 /* If _POSIX_PRIORITIZED_IO and<span style="background-color: #FF0000"> </span>
                                   _POSIX_PRIORITY_SCHEDULING are defined */<span style="background-color: #FF0000"> </span>
     int priority;               /* see above */
<font color='#880000'>-    rtems_chain_node next_prio; /* chain requests in order of priority */
</font>     pthread_t caller_thread;    /* used for notification */
     struct aiocb *aiocbp;       /* aio control block */
   } rtems_aio_request;
 
   typedef struct
   {
<font color='#880000'>-    int fildes;                 /* file descriptor to be processed */<span style="background-color: #FF0000">  </span>
-    int new_fd;                 /* if this is a newly created chain */
</font>     rtems_chain_node next_fd;   /* order fd chains in queue */
     rtems_chain_control perfd;  /* chain of requests for this fd */
<font color='#000088'>+    int fildes;                 /* file descriptor to be processed */
+    int new_fd;                 /* if this is a newly created chain */
</font>     pthread_mutex_t mutex;<span style="background-color: #FF0000">      </span>
     pthread_cond_t cond;
 

<font color='#006600'>diff -u rtems/cpukit/posix/src/aio_misc.c:1.4 rtems/cpukit/posix/src/aio_misc.c:1.5
--- rtems/cpukit/posix/src/aio_misc.c:1.4       Fri Aug 20 09:37:08 2010
+++ rtems/cpukit/posix/src/aio_misc.c   Mon Nov  1 12:32:53 2010
</font><font color='#997700'>@@ -94,11 +94,11 @@
</font>   rtems_aio_request_chain *r_chain;
   rtems_chain_node *node;
 
<font color='#880000'>-  node = chain->first;
</font><font color='#000088'>+  node = rtems_chain_first (chain);
</font>   r_chain = (rtems_aio_request_chain *) node;
 
   while (r_chain->fildes < fildes && !rtems_chain_is_tail (chain, node)) {
<font color='#880000'>-    node = node->next;
</font><font color='#000088'>+    node = rtems_chain_next (node);
</font>     r_chain = (rtems_aio_request_chain *) node;
   }
 
<font color='#997700'>@@ -114,9 +114,10 @@
</font>       if (rtems_chain_is_empty (chain))
         rtems_chain_prepend (chain, &r_chain->next_fd);
       else
<font color='#880000'>-        rtems_chain_insert (node->previous, &r_chain->next_fd);
</font><font color='#000088'>+        rtems_chain_insert (rtems_chain_previous (node), &r_chain->next_fd);
</font> 
       r_chain->new_fd = 1;
<font color='#000088'>+     r_chain->fildes = fildes;
</font>     }
   }
   return r_chain;
<font color='#997700'>@@ -142,7 +143,7 @@
</font>   rtems_chain_node *node;
 
   AIO_printf ("FD exists \n");
<font color='#880000'>-  node = chain->first;
</font><font color='#000088'>+  node = rtems_chain_first (chain);
</font> 
   if (rtems_chain_is_empty (chain)) {
     AIO_printf ("First in chain \n");
<font color='#997700'>@@ -153,7 +154,7 @@
</font> 
     while (req->aiocbp->aio_reqprio > prio &&
            !rtems_chain_is_tail (chain, node)) {
<font color='#880000'>-      node = node->next;
</font><font color='#000088'>+      node = rtems_chain_next (node);
</font>       prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio;
     }
 
<font color='#997700'>@@ -180,7 +181,7 @@
</font>   rtems_chain_node *node;
 
   chain = &r_chain->perfd;
<font color='#880000'>-  node = chain->first;
</font><font color='#000088'>+  node = rtems_chain_first (chain);
</font>   
   while (!rtems_chain_is_tail (chain, node))
     {
<font color='#997700'>@@ -210,13 +211,13 @@
</font> 
 int rtems_aio_remove_req (rtems_chain_control *chain, struct aiocb *aiocbp)
 {
<font color='#880000'>-  rtems_chain_node *node = chain->first;
</font><font color='#000088'>+  rtems_chain_node *node = rtems_chain_first (chain);
</font>   rtems_aio_request *current;
   
   current = (rtems_aio_request *) node;
 
   while (!rtems_chain_is_tail (chain, node) && current->aiocbp != aiocbp) {
<font color='#880000'>-    node = node->next;
</font><font color='#000088'>+    node = rtems_chain_next (node);
</font>     current = (rtems_aio_request *) node;
   }
   
<font color='#997700'>@@ -257,7 +258,7 @@
</font>   struct sched_param param;
 
   /* The queue should be initialized */
<font color='#880000'>-  AIO_assert (aio_request_queue.initialized != AIO_QUEUE_INITIALIZED);
</font><font color='#000088'>+  AIO_assert (aio_request_queue.initialized == AIO_QUEUE_INITIALIZED);
</font> 
   result = pthread_mutex_lock (&aio_request_queue.mutex);
   if (result != 0) {
<font color='#997700'>@@ -288,7 +289,7 @@
</font>   pthread_mutex_init (&r_chain->mutex, NULL);
        pthread_cond_init (&r_chain->cond, NULL);
        
<font color='#880000'>-   AIO_printf ("New thread");
</font><font color='#000088'>+      AIO_printf ("New thread \n");
</font>   result = pthread_create (&thid, &aio_request_queue.attr,
                                 rtems_aio_handle, (void *) r_chain);
        if (result != 0) {
<font color='#997700'>@@ -328,11 +329,13 @@
</font>   if (r_chain->new_fd == 1) {
          /* If this is a new fd chain we signal the idle threads that
             might be waiting for requests */
<font color='#000088'>+     AIO_printf (" New chain on waiting queue \n ");
</font>     rtems_chain_prepend (&r_chain->perfd, &req->next_prio);
          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);
<font color='#000088'>+     ++aio_request_queue.idle_threads;
</font>   } else
          /* just insert the request in the existing fd chain */
          rtems_aio_insert_prio (&r_chain->perfd, req);
<font color='#997700'>@@ -387,7 +390,7 @@
</font>        requests to this fd chain */
     if (!rtems_chain_is_empty (chain)) {
 
<font color='#880000'>-      node = chain->first;
</font><font color='#000088'>+      node = rtems_chain_first (chain);
</font>       req = (rtems_aio_request *) node;
       
       /* See _POSIX_PRIORITIZE_IO and _POSIX_PRIORITY_SCHEDULING
<font color='#997700'>@@ -481,7 +484,7 @@
</font>         /* Otherwise move this chain to the working chain and<span style="background-color: #FF0000"> </span>
                 start the loop all over again */
              --aio_request_queue.idle_threads;
<font color='#880000'>-         node = aio_request_queue.idle_req.first;
</font><font color='#000088'>+            node = rtems_chain_first (&aio_request_queue.idle_req);
</font>         rtems_chain_extract (node);
              r_chain = rtems_aio_search_fd (&aio_request_queue.work_req,
                                             ((rtems_aio_request_chain *)node)->fildes,
</pre>
<p> </p>
<a name='cs2'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
 <font color='#bb2222'><strong>joel</strong></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>2010-11-01 Alin Rus <alin.codejunkie@gmail.com>

        * psxaio01/init.c, psxaio02/init.c: Improve coverage.
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtests/ChangeLog.diff?r1=text&tr1=1.323&r2=text&tr2=1.324&diff_format=h">M</a></td><td width='1%'>1.324</td><td width='100%'>testsuites/psxtests/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtests/psxaio01/init.c.diff?r1=text&tr1=1.1&r2=text&tr2=1.2&diff_format=h">M</a></td><td width='1%'>1.2</td><td width='100%'>testsuites/psxtests/psxaio01/init.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtests/psxaio02/init.c.diff?r1=text&tr1=1.1&r2=text&tr2=1.2&diff_format=h">M</a></td><td width='1%'>1.2</td><td width='100%'>testsuites/psxtests/psxaio02/init.c</td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/testsuites/psxtests/ChangeLog:1.323 rtems/testsuites/psxtests/ChangeLog:1.324
--- rtems/testsuites/psxtests/ChangeLog:1.323   Thu Oct 21 17:09:44 2010
+++ rtems/testsuites/psxtests/ChangeLog Mon Nov  1 12:33:06 2010
</font><font color='#997700'>@@ -1,3 +1,7 @@
</font><font color='#000088'>+2010-11-01    Alin Rus <alin.codejunkie@gmail.com>
+
+       * psxaio01/init.c, psxaio02/init.c: Improve coverage.
+
</font> 2010-10-21        Joel Sherrill <joel.sherrill@oarcorp.com>
 
        * psx05/init.c: Check for correct status returned.

<font color='#006600'>diff -u rtems/testsuites/psxtests/psxaio01/init.c:1.1 rtems/testsuites/psxtests/psxaio01/init.c:1.2
--- rtems/testsuites/psxtests/psxaio01/init.c:1.1       Mon Aug 16 08:29:48 2010
+++ rtems/testsuites/psxtests/psxaio01/init.c   Mon Nov  1 12:33:08 2010
</font><font color='#997700'>@@ -24,7 +24,7 @@
</font> #define WRONG_FD 404
 
 struct aiocb *
<font color='#880000'>-create_aiocb (void)
</font><font color='#000088'>+create_aiocb (int fd)
</font> {
   struct aiocb *aiocbp;
 
<font color='#997700'>@@ -34,7 +34,7 @@
</font>   aiocbp->aio_nbytes = BUFSIZE;
   aiocbp->aio_offset = 0;
   aiocbp->aio_reqprio = 0;
<font color='#880000'>-  aiocbp->aio_fildes = open ("aio_fildes", O_RDWR | O_CREAT);
</font><font color='#000088'>+  aiocbp->aio_fildes = fd;
</font> 
   return aiocbp;
 }
<font color='#997700'>@@ -49,101 +49,145 @@
</font> void *
 POSIX_Init (void *argument)
 {
<font color='#880000'>-  int result, policy;
</font><font color='#000088'>+  int result, fd;
</font>   struct aiocb *aiocbp;
<font color='#880000'>-  rtems_status_code status;
-  struct sched_param param;
</font><font color='#000088'>+  int status;
+
+  rtems_aio_init ();
+
+  status = mkdir ("/tmp", S_IRWXU);
+  rtems_test_assert (!status);
+<span style="background-color: #FF0000">  </span>
+  fd = open ("/tmp/aio_fildes", O_RDWR|O_CREAT, S_IRWXU|S_IRWXG|S_IRWXO);
+  rtems_test_assert ( fd != -1);
</font> 
   puts ("\n\n*** POSIX AIO TEST 01 ***");
 
<font color='#880000'>-  puts ("\n*** POSIX aio_write() test ***");
</font><font color='#000088'>+  puts (" Init: EBADF TESTS ");
</font> 
<font color='#880000'>-  /* Request canceled */
-  puts ("Init: aio_write - ECANCELED");
</font><font color='#000088'>+  aiocbp = create_aiocb (WRONG_FD);
+  status = aio_write (aiocbp);
+  rtems_test_assert (status == -1);
+
+  /* Bad file descriptor */
+  puts ("Init: aio_write() - EBADF ");
</font> 
<font color='#880000'>-  aiocbp = create_aiocb ();
-  aio_write (aiocbp);
-  aio_cancel (aiocbp->aio_fildes, aiocbp);
</font>   result = aio_return (aiocbp);
<font color='#880000'>-  rtems_test_assert (result != -1);
</font><font color='#000088'>+  rtems_test_assert (result == -1);
</font>   status = aio_error (aiocbp);
<font color='#880000'>-  rtems_test_assert (status != ECANCELED);
-  free_aiocb (aiocbp);
</font><font color='#000088'>+  rtems_test_assert (status == EBADF);
</font> 
<font color='#880000'>-  /* Successfull added request to queue */
-  puts ("Init: aio_write - SUCCESSFUL");
-  aiocbp = create_aiocb ();
-  aiocbp->aio_fildes = WRONG_FD;
-  status = aio_write (aiocbp);
-  rtems_test_assert (!status);
</font><font color='#000088'>+  status = aio_read (aiocbp);
+  rtems_test_assert (status == -1);
+
+  /* Bad file descriptor */
+  puts ("Init: aio_read() - EBADF ");
</font> 
<font color='#880000'>-  pthread_getschedparam (pthread_self (), &policy, &param);
-  policy = SCHED_RR;
-  param.sched_priority = 30;
-  pthread_setschedparam (pthread_self (), policy, &param);
-  sleep (1);
</font><font color='#000088'>+  result = aio_return (aiocbp);
+  rtems_test_assert (result == -1);
+  status = aio_error (aiocbp);
+  rtems_test_assert (status == EBADF);
</font> 
<font color='#880000'>-  while (aio_error (aiocbp) == EINPROGRESS);
</font><font color='#000088'>+  status = aio_cancel (WRONG_FD, NULL);
+  rtems_test_assert (status == -1);
</font> 
   /* Bad file descriptor */
<font color='#880000'>-  puts ("Init: aio_write() - EBADF ");
</font><font color='#000088'>+  puts ("Init: aio_cancel() - EBADF ");
+<span style="background-color: #FF0000">  </span>
+  result = aio_return (aiocbp);
+  rtems_test_assert (result == -1);
+  status = aio_error (aiocbp);
+  rtems_test_assert (status == EBADF);
+
+  status = aio_fsync (O_SYNC, aiocbp);
+  rtems_test_assert (status == -1);
+<span style="background-color: #FF0000">  </span>
+  /* Bad file descriptor */
+  puts ("Init: aio_fsync() - EBADF ");
</font> 
   result = aio_return (aiocbp);
<font color='#880000'>-  rtems_test_assert (result != -1);
</font><font color='#000088'>+  rtems_test_assert (result == -1);
</font>   status = aio_error (aiocbp);
<font color='#880000'>-  rtems_test_assert (status != EBADF);
</font><font color='#000088'>+  rtems_test_assert (status == EBADF);
+<span style="background-color: #FF0000">  </span>
</font>   free_aiocb (aiocbp);
 
   /* Invalid offset */
   puts ("Init: aio_write() - EINVAL [aio_offset]");
 
<font color='#880000'>-  aiocbp = create_aiocb ();
</font><font color='#000088'>+  aiocbp = create_aiocb (fd);
</font>   aiocbp->aio_offset = -1;
<font color='#880000'>-  aio_write (aiocbp);
-  sleep (1);
</font><font color='#000088'>+  status = aio_write (aiocbp);
+  rtems_test_assert (status == -1);
+
+  result = aio_return (aiocbp);
+  rtems_test_assert (result == -1);
+  status = aio_error (aiocbp);
+  rtems_test_assert (status == EINVAL);
</font> 
<font color='#880000'>-  while (aio_error (aiocbp) == EINPROGRESS);
</font><font color='#000088'>+    /* Invalid offset */
+  puts ("Init: aio_read() - EINVAL [aio_offset]");
+
+  status = aio_read (aiocbp);
+  rtems_test_assert (status == -1);
</font> 
   result = aio_return (aiocbp);
<font color='#880000'>-  rtems_test_assert (result != -1);
</font><font color='#000088'>+  rtems_test_assert (result == -1);
</font>   status = aio_error (aiocbp);
<font color='#880000'>-  rtems_test_assert (status != EINVAL);
</font><font color='#000088'>+  rtems_test_assert (status == EINVAL);
+
</font>   free_aiocb (aiocbp);
 
   /* Invalid request priority */
   puts ("Init: aio_write() - EINVAL [aio_reqprio]");
 
<font color='#880000'>-  aiocbp = create_aiocb ();
</font><font color='#000088'>+  aiocbp = create_aiocb (fd);
</font>   aiocbp->aio_reqprio = AIO_PRIO_DELTA_MAX + 1;
<font color='#880000'>-  aio_write (aiocbp);
-  sleep (1);
</font><font color='#000088'>+  status = aio_write (aiocbp);
+  rtems_test_assert (status == -1);
+
+  result = aio_return (aiocbp);
+  rtems_test_assert (result == -1);
+  status = aio_error (aiocbp);
+  rtems_test_assert (status == EINVAL);
+
+   /* Invalid request priority */
+  puts ("Init: aio_read() - EINVAL [aio_reqprio]");
</font> 
<font color='#880000'>-  while (aio_error (aiocbp) == EINPROGRESS);
</font><font color='#000088'>+  status = aio_read (aiocbp);
+  rtems_test_assert (status == -1);
</font> 
   result = aio_return (aiocbp);
<font color='#880000'>-  rtems_test_assert (result != -1);
</font><font color='#000088'>+  rtems_test_assert (result == -1);
</font>   status = aio_error (aiocbp);
<font color='#880000'>-  rtems_test_assert (status != EINVAL);
-  free_aiocb (aiocbp);
</font><font color='#000088'>+  rtems_test_assert (status == EINVAL);
</font> 
<font color='#880000'>-  /* aio_nbytes > 0 and aio_offset >= SEEK_END */
-  puts ("Init: aio_write() - EFBIG");
-  aiocbp = create_aiocb ();
-  aiocbp->aio_nbytes = 1;
-  aiocbp->aio_offset = lseek (aiocbp->aio_fildes, 0, SEEK_END) + 1;
-  aio_write (aiocbp);
-  sleep (1);
</font><font color='#000088'>+  /* Invalid request aio_cancel */
+  puts ("Init: aio_cancel() - EINVAL ");
</font> 
<font color='#880000'>-  while (aio_error (aiocbp) == EINPROGRESS);
</font><font color='#000088'>+  status = aio_cancel (WRONG_FD, aiocbp);
+  rtems_test_assert (status == -1);
</font> 
   result = aio_return (aiocbp);
<font color='#880000'>-  rtems_test_assert (result != -1);
</font><font color='#000088'>+  rtems_test_assert (result == -1);
</font>   status = aio_error (aiocbp);
<font color='#880000'>-  rtems_test_assert (status != EFBIG);
</font><font color='#000088'>+  rtems_test_assert (status == EINVAL);
+
+  /* Invalid operation to aio_fsync */
+  puts ("Init: aio_fsync() - EINVAL ");
+  status = aio_fsync (-1, aiocbp);
+  rtems_test_assert (status == -1);
+
+  result = aio_return (aiocbp);
+  rtems_test_assert (result == -1);
+  status = aio_error (aiocbp);
+  rtems_test_assert (status == EINVAL);
+
</font>   free_aiocb (aiocbp);
 
   puts ("*** END OF POSIX AIO TEST 01 ***");
 
<font color='#000088'>+  close (fd);
</font>   rtems_test_exit (0);
 
   return NULL;

<font color='#006600'>diff -u rtems/testsuites/psxtests/psxaio02/init.c:1.1 rtems/testsuites/psxtests/psxaio02/init.c:1.2
--- rtems/testsuites/psxtests/psxaio02/init.c:1.1       Mon Aug 16 08:29:48 2010
+++ rtems/testsuites/psxtests/psxaio02/init.c   Mon Nov  1 12:33:08 2010
</font><font color='#997700'>@@ -19,12 +19,13 @@
</font> #include <stdio.h>
 #include <sched.h>
 #include <fcntl.h>
<font color='#000088'>+#include <rtems/chain.h>
</font> 
<font color='#880000'>-#define BUFSIZE 512
-#define WRONG_FD 404
</font><font color='#000088'>+#define BUFSIZE 32
+#define MAX 7
</font> 
 struct aiocb *
<font color='#880000'>-create_aiocb (void)
</font><font color='#000088'>+create_aiocb (int fd)
</font> {
   struct aiocb *aiocbp;
 
<font color='#997700'>@@ -34,7 +35,7 @@
</font>   aiocbp->aio_nbytes = BUFSIZE;
   aiocbp->aio_offset = 0;
   aiocbp->aio_reqprio = 0;
<font color='#880000'>-  aiocbp->aio_fildes = open ("aio_fildes", O_RDWR | O_CREAT);
</font><font color='#000088'>+  aiocbp->aio_fildes = fd;
</font> 
   return aiocbp;
 }
<font color='#997700'>@@ -49,101 +50,84 @@
</font> void *
 POSIX_Init (void *argument)
 {
<font color='#880000'>-  int result, policy;
-  struct aiocb *aiocbp;
-  rtems_status_code status;
-  struct sched_param param;
-
</font><font color='#000088'>+  int fd[MAX];
+  struct aiocb *aiocbp[MAX+2];
+  int status, i;
+  char filename[BUFSIZE];
+
+  status = rtems_aio_init ();
+  rtems_test_assert (status == 0);
+<span style="background-color: #FF0000"> </span>
+  status = mkdir ("/tmp", S_IRWXU);
+  rtems_test_assert (!status);
+<span style="background-color: #FF0000">  </span>
</font>   puts ("\n\n*** POSIX AIO TEST 02 ***");
<font color='#000088'>+<span style="background-color: #FF0000">  </span>
+  puts (" Init: Open files ");
</font> 
<font color='#880000'>-  puts ("\n*** POSIX aio_read() test ***");
-
-  /* Request canceled */
-  puts ("Init: aio_read - ECANCELED");
</font><font color='#000088'>+  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);
+    }
+<span style="background-color: #FF0000">  </span>
+  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);
+<span style="background-color: #FF0000">  </span>
+  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);
+<span style="background-color: #FF0000">  </span>
+  puts (" Init: [WQ] aio_write on 3rd file ");<span style="background-color: #FF0000"> </span>
+  aiocbp[3] = create_aiocb (fd[2]);
+  status = aio_write (aiocbp[3]);
+  rtems_test_assert (status != -1);
+<span style="background-color: #FF0000">  </span>
+  puts (" Init: [WQ] aio_write on 4th file ");
+  aiocbp[4] = create_aiocb (fd[3]);
+  status = aio_write (aiocbp[4]);
+  rtems_test_assert (status != -1);
+<span style="background-color: #FF0000">  </span>
+  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);
+<span style="background-color: #FF0000">  </span>
+  puts (" Init: [IQ] aio_write on 6th file ");
+  aiocbp[6] = create_aiocb (fd[5]);
+  status = aio_write (aiocbp[6]);
+  rtems_test_assert (status != -1);
+<span style="background-color: #FF0000">  </span>
+  puts (" Init: [IQ] aio_write on 7th file ");
+  aiocbp[7] = create_aiocb (fd[6]);
+  status = aio_write (aiocbp[7]);
+  rtems_test_assert (status != -1);
+
+  puts (" Init: [IQ] aio_read on 7th file add by priority ");
+  aiocbp[8] = create_aiocb (fd[6]);
+  status = aio_read (aiocbp[8]);
+  rtems_test_assert (status != -1);
</font> 
<font color='#880000'>-  aiocbp = create_aiocb ();
-  aio_read (aiocbp);
-  aio_cancel (aiocbp->aio_fildes, aiocbp);
-  result = aio_return (aiocbp);
-  rtems_test_assert (result != -1);
-  status = aio_error (aiocbp);
-  rtems_test_assert (status != ECANCELED);
-  free_aiocb (aiocbp);
-
-  /* Successfull added request to queue */
-  puts ("Init: aio_read - SUCCESSFUL");
-  aiocbp = create_aiocb ();
-  aiocbp->aio_fildes = WRONG_FD;
-  status = aio_read (aiocbp);
-  rtems_test_assert (!status);
-
-  pthread_getschedparam (pthread_self (), &policy, &param);
-  policy = SCHED_RR;
-  param.sched_priority = 30;
-  pthread_setschedparam (pthread_self (), policy, &param);
-  sleep (1);
-
-  while (aio_error (aiocbp) == EINPROGRESS);
-
-  /* Bad file descriptor */
-  puts ("Init: aio_read() - EBADF ");
-
-  result = aio_return (aiocbp);
-  rtems_test_assert (result != -1);
-  status = aio_error (aiocbp);
-  rtems_test_assert (status != EBADF);
-  free_aiocb (aiocbp);
-
-  /* Invalid offset */
-  puts ("Init: aio_read() - EINVAL [aio_offset]");
-
-  aiocbp = create_aiocb ();
-  aiocbp->aio_offset = -1;
-  aio_read (aiocbp);
-  sleep (1);
-
-  while (aio_error (aiocbp) == EINPROGRESS);
-
-  result = aio_return (aiocbp);
-  rtems_test_assert (result != -1);
-  status = aio_error (aiocbp);
-  rtems_test_assert (status != EINVAL);
-  free_aiocb (aiocbp);
-
-  /* Invalid request priority */
-  puts ("Init: aio_read() - EINVAL [aio_reqprio]");
-
-  aiocbp = create_aiocb ();
-  aiocbp->aio_reqprio = AIO_PRIO_DELTA_MAX + 1;
-  aio_read (aiocbp);
-  sleep (1);
-
-  while (aio_error (aiocbp) == EINPROGRESS);
-
-  result = aio_return (aiocbp);
-  rtems_test_assert (result != -1);
-  status = aio_error (aiocbp);
-  rtems_test_assert (status != EINVAL);
-  free_aiocb (aiocbp);
-
-  /* aio_nbytes > 0 && aio_nbytes + aio_offset > max offset of aio_fildes */
-  puts ("Init: aio_read() - OVERFLOW");
-  aiocbp = create_aiocb ();
-  aiocbp->aio_nbytes = 10;
-  aiocbp->aio_offset = lseek (aiocbp->aio_fildes, 0, SEEK_END);
-  aio_read (aiocbp);
-  sleep (1);
-
-  while (aio_error (aiocbp) == EINPROGRESS);
-
-  result = aio_return (aiocbp);
-  rtems_test_assert (result != -1);
-  status = aio_error (aiocbp);
-  rtems_test_assert (status != EFBIG);
-  free_aiocb (aiocbp);
</font><font color='#000088'>+  puts ("\n\n*** POSIX AIO TEST 02 ***");
</font> 
   puts ("*** END OF POSIX AIO TEST 01 ***");
 
<font color='#000088'>+  for (i = 0; i < MAX; i++)
+    {
+      close (fd[i]);
+      free_aiocb (aiocbp[i]);<span style="background-color: #FF0000">      </span>
+    }
+  free_aiocb (aiocbp[i]);
+  free_aiocb (aiocbp[i+1]);
</font>   rtems_test_exit (0);
 
   return NULL;
</pre>
<p> </p>

<p>--<br />
<small>Generated by <a href="http://www.codewiz.org/projects/index.html#loginfo">Deluxe Loginfo</a> 2.122 by Bernardo Innocenti <bernie@develer.com></small></p>
</body>
</html>