diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-07-29 20:15:33 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-07-29 20:15:33 +0000 |
commit | 330e858cc23e3ef43836a5015ce64fd9d42db3b1 (patch) | |
tree | a8beb7273ea08163455b0756438609429ec4daa7 /testsuites/psxtests/psxmsgq04/init.c | |
parent | 2009-07-29 Joel Sherrill <joel.sherrill@oarcorp.com> (diff) | |
download | rtems-330e858cc23e3ef43836a5015ce64fd9d42db3b1.tar.bz2 |
2009-07-29 Joel Sherrill <joel.sherrill@oarcorp.com>
* Makefile.am, configure.ac: Add shell of new test.
* psxmsgq04/.cvsignore, psxmsgq04/Makefile.am, psxmsgq04/init.c,
psxmsgq04/psxmsgq04.doc, psxmsgq04/psxmsgq04.scn: New files.
Diffstat (limited to 'testsuites/psxtests/psxmsgq04/init.c')
-rw-r--r-- | testsuites/psxtests/psxmsgq04/init.c | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/testsuites/psxtests/psxmsgq04/init.c b/testsuites/psxtests/psxmsgq04/init.c new file mode 100644 index 0000000000..a4f3bacd4a --- /dev/null +++ b/testsuites/psxtests/psxmsgq04/init.c @@ -0,0 +1,68 @@ +/* + * COPYRIGHT (c) 1989-2009. + * 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.com/license/LICENSE. + * + * $Id$ + */ + +#include <pmacros.h> +#include <unistd.h> +#include <errno.h> +#include <tmacros.h> + +#include <fcntl.h> /* For O_* constants */ +#include <sys/stat.h> /* For mode constants */ +#include <mqueue.h> + +#include "test_support.h" + +void *POSIX_Init( + void *argument +) +{ + struct mq_attr attr; + mqd_t Queue; + int sc; + + puts( "\n\n*** POSIX MESSAGE QUEUE TEST 4 ***" ); + + attr.mq_maxmsg = 1; + attr.mq_msgsize = sizeof(int); + + puts( "Init - Open message queue" ); + Queue = mq_open( "Queue", O_CREAT | O_RDWR, 0x777, &attr ); + if ( Queue == (-1) ) + perror( "mq_open failed" ); + assert( Queue != (-1) ); + + puts( "Init - Close message queue" ); + sc = mq_close( Queue ); + if ( sc != 0 ) + perror( "mq_close failed" ); + assert( sc == 0 ); + + puts( "*** END OF POSIX MESSAGE QUEUE TEST 4 ***" ); + rtems_test_exit( 0 ); + + return NULL; /* just so the compiler thinks we returned something */ +} + +/* configuration information */ + +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER +#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER + +#define CONFIGURE_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 1 +#define CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES 1 + +#define CONFIGURE_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_INIT +#include <rtems/confdefs.h> +/* end of include file */ |