Index: testsuites/psxtests/ChangeLog
===================================================================
--- testsuites/psxtests/ChangeLog	(revision 5f6e7415b7b71cbd847d8968e4cddb332ddb09f0)
+++ testsuites/psxtests/ChangeLog	(revision 408eea8879966e73a382b53428961d60dd99cb86)
@@ -1,2 +1,11 @@
+2011-03-08	Joel Sherrill <joel.sherrilL@OARcorp.com>
+
+	PR 1759/cpukit
+	* Makefile.am, configure.ac: Add test to use some pthread calls with
+	Classic Tasks.
+	* psxclassic01/.cvsignore, psxclassic01/Makefile.am,
+	psxclassic01/init.c, psxclassic01/psxclassic01.doc,
+	psxclassic01/psxclassic01.scn: New files.
+
 2011-02-22	Ralf CorsÃÂ©pius <ralf.corsepius@rtems.org>
 
Index: testsuites/psxtests/Makefile.am
===================================================================
--- testsuites/psxtests/Makefile.am	(revision 5f6e7415b7b71cbd847d8968e4cddb332ddb09f0)
+++ testsuites/psxtests/Makefile.am	(revision 408eea8879966e73a382b53428961d60dd99cb86)
@@ -10,5 +10,5 @@
     psx10 psx11 psx12 psx13 psx14 psx15 psxaio01 psxaio02 psxaio03 \
     psxalarm01 psxautoinit01 psxautoinit02 psxbarrier01 \
-    psxcancel psxcancel01 psxcleanup psxcleanup01 \
+    psxcancel psxcancel01 psxclassic01 psxcleanup psxcleanup01 \
     psxcond01 psxenosys psxkey01 psxkey02 psxkey03 \
     psxitimer psxmsgq01 psxmsgq02 psxmsgq03 psxmsgq04 \
Index: testsuites/psxtests/configure.ac
===================================================================
--- testsuites/psxtests/configure.ac	(revision 5f6e7415b7b71cbd847d8968e4cddb332ddb09f0)
+++ testsuites/psxtests/configure.ac	(revision 408eea8879966e73a382b53428961d60dd99cb86)
@@ -107,4 +107,5 @@
 psxcancel01/Makefile
 psxchroot01/Makefile
+psxclassic01/Makefile
 psxcleanup/Makefile
 psxcleanup01/Makefile
Index: testsuites/psxtests/psxclassic01/.cvsignore
===================================================================
--- testsuites/psxtests/psxclassic01/.cvsignore	(revision 408eea8879966e73a382b53428961d60dd99cb86)
+++ testsuites/psxtests/psxclassic01/.cvsignore	(revision 408eea8879966e73a382b53428961d60dd99cb86)
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
Index: testsuites/psxtests/psxclassic01/Makefile.am
===================================================================
--- testsuites/psxtests/psxclassic01/Makefile.am	(revision 408eea8879966e73a382b53428961d60dd99cb86)
+++ testsuites/psxtests/psxclassic01/Makefile.am	(revision 408eea8879966e73a382b53428961d60dd99cb86)
@@ -0,0 +1,28 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = psxclassic01
+psxclassic01_SOURCES = init.c ../include/pmacros.h
+
+dist_rtems_tests_DATA = psxclassic01.scn
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+psxclassic01_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/include
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+
+LINK_OBJS = $(psxclassic01_OBJECTS) $(psxclassic01_LDADD)
+LINK_LIBS = $(psxclassic01_LDLIBS)
+
+psxclassic01$(EXEEXT): $(psxclassic01_OBJECTS) $(psxclassic01_DEPENDENCIES)
+	@rm -f psxclassic01$(EXEEXT)
+	$(make-exe)
+
+include $(top_srcdir)/../automake/local.am
Index: testsuites/psxtests/psxclassic01/init.c
===================================================================
--- testsuites/psxtests/psxclassic01/init.c	(revision 408eea8879966e73a382b53428961d60dd99cb86)
+++ testsuites/psxtests/psxclassic01/init.c	(revision 408eea8879966e73a382b53428961d60dd99cb86)
@@ -0,0 +1,153 @@
+/*
+ *  Based upon user code supplied in conjunction with PR1759
+ *
+ *  COPYRIGHT (c) 1989-2011.
+ *  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 "tmacros.h"
+
+#include <stdio.h>
+#include <rtems.h>
+#include <pthread.h>
+#include <unistd.h>
+#include <errno.h>
+
+int       Caught_signo = -1;
+siginfo_t Caught_siginfo = { -1, -1, };
+
+void handler(int signo)
+{
+  Caught_signo = signo;
+}
+
+void handler_info(int signo, siginfo_t *info, void *context)
+{
+  Caught_signo = signo;
+  Caught_siginfo = *info;
+}
+
+rtems_task test_task(rtems_task_argument arg)
+{
+  int sc;
+  struct sigaction new_action;
+  sigset_t mask;
+
+  printf("test_task starting...\n");
+
+  sc = sigemptyset (&new_action.sa_mask);
+  rtems_test_assert( sc == 0 );
+
+  sc = sigfillset  (&new_action.sa_mask);
+  rtems_test_assert( sc == 0 );
+
+  sc = sigdelset   (&new_action.sa_mask, SIGUSR1);
+  rtems_test_assert( sc == 0 );
+
+  new_action.sa_handler = handler;
+  new_action.sa_flags = SA_SIGINFO;
+  new_action.sa_sigaction = handler_info;
+
+  sc = sigaction(SIGUSR1,&new_action,NULL);
+  rtems_test_assert( sc == 0 );
+
+  sc = sigemptyset(&mask);
+  rtems_test_assert( sc == 0 );
+
+  sc = sigaddset(&mask, SIGUSR1);
+  rtems_test_assert( sc == 0 );
+
+  sc = pthread_sigmask( SIG_UNBLOCK, &mask, NULL);
+  rtems_test_assert( sc == 0 );
+
+  printf("test_task waiting for signal...\n");
+
+  while(1) {
+    sleep(1);
+    if ( Caught_siginfo.si_signo != -1 ) {
+      printf( "Signal_info: %d si_signo= %d si_code= %d value= %d\n",
+        Caught_signo,
+        Caught_siginfo.si_signo,
+        Caught_siginfo.si_code,
+        Caught_siginfo.si_value.sival_int
+      );
+      break;
+    }
+    if ( Caught_signo != -1 ) {
+      printf( "Signal: %d caught\n", Caught_signo );
+      break;
+    }
+  }
+  puts( "test_task exiting thread" );
+  pthread_exit( 0 );
+}
+
+rtems_task Init(rtems_task_argument arg)
+{
+  rtems_status_code sc;
+  rtems_id          task_id;
+  int               status;
+  void             *retval;
+
+  puts( "*** START OF CLASSIC API TEST OF POSIX 01 ***" );
+
+  sc = rtems_task_create(
+    rtems_build_name('T','E','S','T'),
+    1,
+    RTEMS_MINIMUM_STACK_SIZE,
+    RTEMS_DEFAULT_MODES,
+    RTEMS_DEFAULT_ATTRIBUTES,
+    &task_id
+  );
+  rtems_test_assert( sc == RTEMS_SUCCESSFUL );
+
+  sc = rtems_task_start( task_id,  test_task, 0 );
+  rtems_test_assert( sc == RTEMS_SUCCESSFUL );
+
+
+  puts( "Init - pthread_equal on Classic Ids" );
+  status = pthread_equal( task_id, task_id );
+  rtems_test_assert( status != 0 );
+  
+  puts( "Init - pthread_cancel on Classic Task" );
+  status = pthread_cancel( task_id );
+  rtems_test_assert( status == 0 );
+  
+  status = pthread_detach( task_id );
+  rtems_test_assert( status == 0 );
+
+  status = pthread_join( task_id, &retval );
+  if ( status != EINVAL ) printf( "JOIN %s\n", strerror( status ) );
+  rtems_test_assert( status == EINVAL );
+
+  status = pthread_kill( task_id, SIGUSR1 );
+  rtems_test_assert( status == 0 );
+
+  puts( "*** END OF CLASSIC API TEST OF POSIX 01 ***" );
+  exit(0);
+}
+
+/* configuration information */
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
+
+#define CONFIGURE_MAXIMUM_TASKS 2
+
+#define CONFIGURE_INIT_TASK_INITIAL_MODES \
+  (RTEMS_PREEMPT | RTEMS_NO_TIMESLICE | RTEMS_ASR | RTEMS_INTERRUPT_LEVEL(0))
+
+#define CONFIGURE_INIT_TASK_PRIORITY 4
+#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
+
+#define CONFIGURE_UNIFIED_WORK_AREAS
+
+#define CONFIGURE_INIT
+#include <rtems/confdefs.h>
+/* end of file */
Index: testsuites/psxtests/psxclassic01/psxclassic01.scn
===================================================================
--- testsuites/psxtests/psxclassic01/psxclassic01.scn	(revision 408eea8879966e73a382b53428961d60dd99cb86)
+++ testsuites/psxtests/psxclassic01/psxclassic01.scn	(revision 408eea8879966e73a382b53428961d60dd99cb86)
@@ -0,0 +1,8 @@
+*** START OF CLASSIC API TEST OF POSIX 01 ***
+test_task starting...
+test_task waiting for signal...
+Init - pthread_equal on Classic Ids
+Init - pthread_cancel on Classic Task
+Signal_info: 25 si_signo= 0 si_code= 0 value= 0
+test_task exiting thread
+*** END OF CLASSIC API TEST OF POSIX 01 ***
