summaryrefslogtreecommitdiffstats
path: root/cpukit/posix
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2010-10-04 15:32:36 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2010-10-04 15:32:36 +0000
commit21dd3ab8b66a29d38a829822ae732ab0ac8e6e62 (patch)
treefc5169d6fc9ad9b5a19d01f9d284eec9d8253f9b /cpukit/posix
parentRegenerate. (diff)
downloadrtems-21dd3ab8b66a29d38a829822ae732ab0ac8e6e62.tar.bz2
2010-10-04 Joel Sherrill <joel.sherrill@oarcorp.com>
* Makefile.am, configure.ac, posix/Makefile.am, posix/src/pthread.c: * posix/src/pthreadattrgetguardsize.c, posix/src/pthreadattrgetstack.c, posix/src/pthreadattrsetguardsize.c, posix/src/pthreadattrsetstack.c: New files.
Diffstat (limited to 'cpukit/posix')
-rw-r--r--cpukit/posix/Makefile.am32
-rw-r--r--cpukit/posix/src/pthread.c3
-rw-r--r--cpukit/posix/src/pthreadattrgetguardsize.c33
-rw-r--r--cpukit/posix/src/pthreadattrgetstack.c35
-rw-r--r--cpukit/posix/src/pthreadattrsetguardsize.c36
-rw-r--r--cpukit/posix/src/pthreadattrsetstack.c42
6 files changed, 167 insertions, 14 deletions
diff --git a/cpukit/posix/Makefile.am b/cpukit/posix/Makefile.am
index c098fd4305..d75dc98eb4 100644
--- a/cpukit/posix/Makefile.am
+++ b/cpukit/posix/Makefile.am
@@ -111,20 +111,24 @@ libposix_a_SOURCES += src/mutexattrdestroy.c src/mutexattrgetprioceiling.c \
src/mutextranslatereturncode.c src/mutextrylock.c src/mutexunlock.c
## PTHREAD_C_FILES
-libposix_a_SOURCES += src/pthread.c src/pthreadsetcputime.c \
- src/pthreadgetcputime.c src/pthreadgetcpuclockid.c src/pthreadonce.c \
- src/pthreadequal.c src/pthreadself.c src/pthreadexit.c \
- src/pthreaddetach.c src/pthreadjoin.c src/pthreadcreate.c \
- src/pthreadattrsetdetachstate.c src/pthreadattrgetdetachstate.c \
- src/pthreadattrgetstackaddr.c src/pthreadattrsetstackaddr.c \
- src/pthreadattrgetstacksize.c src/pthreadattrsetstacksize.c \
- src/pthreadattrinit.c src/pthreadattrdestroy.c \
- src/pthreadsetschedparam.c src/pthreadgetschedparam.c \
- src/pthreadattrsetschedparam.c src/pthreadattrgetschedparam.c \
- src/pthreadattrgetschedpolicy.c src/pthreadattrsetschedpolicy.c \
- src/pthreadattrgetinheritsched.c src/pthreadattrsetinheritsched.c \
- src/pthreadattrgetscope.c src/pthreadattrsetscope.c \
- src/pthreadinitthreads.c src/psxtransschedparam.c
+libposix_a_SOURCES += src/pthreadatfork.c src/pthreadattrdestroy.c \
+ src/pthreadattrgetdetachstate.c src/pthreadattrgetinheritsched.c \
+ src/pthreadattrgetschedparam.c src/pthreadattrgetschedpolicy.c \
+ src/pthreadattrgetscope.c src/pthreadattrgetstackaddr.c \
+ src/pthreadattrgetstack.c src/pthreadattrgetstacksize.c \
+ src/pthreadattrinit.c src/pthreadattrsetdetachstate.c \
+ src/pthreadattrsetguardsize.c src/pthreadattrsetinheritsched.c \
+ src/pthreadattrsetschedparam.c src/pthreadattrsetschedpolicy.c \
+ src/pthreadattrsetscope.c src/pthreadattrsetstackaddr.c \
+ src/pthreadattrsetstack.c src/pthreadattrsetstacksize.c \
+ src/pthreadattrgetguardsize.c src/pthread.c \
+ src/pthreadcreate.c src/pthreaddetach.c src/pthreadequal.c \
+ src/pthreadexit.c src/pthreadgetcpuclockid.c \
+ src/pthreadgetcputime.c src/pthreadgetschedparam.c \
+ src/pthreadinitthreads.c src/pthreadjoin.c src/pthreadkill.c \
+ src/pthreadonce.c src/pthreadself.c src/pthreadsetcputime.c \
+ src/pthreadsetschedparam.c src/pthreadsigmask.c \
+ src/psxpriorityisvalid.c src/psxtransschedparam.c
## PSIGNAL_C_FILES
libposix_a_SOURCES += src/psignal.c src/alarm.c src/kill.c src/killinfo.c \
diff --git a/cpukit/posix/src/pthread.c b/cpukit/posix/src/pthread.c
index 45d0ff18fd..06ce1fe168 100644
--- a/cpukit/posix/src/pthread.c
+++ b/cpukit/posix/src/pthread.c
@@ -55,6 +55,9 @@ const pthread_attr_t _POSIX_Threads_Default_attributes = {
{ 0L, 0 } /* sched_ss_init_budget */
#endif
},
+ #if HAVE_DECL_PTHREAD_ATTR_SETGUARDSIZE
+ 0, /* guardsize */
+ #endif
#if defined(_POSIX_THREAD_CPUTIME)
1, /* cputime_clock_allowed */
#endif
diff --git a/cpukit/posix/src/pthreadattrgetguardsize.c b/cpukit/posix/src/pthreadattrgetguardsize.c
new file mode 100644
index 0000000000..b3c64fbfad
--- /dev/null
+++ b/cpukit/posix/src/pthreadattrgetguardsize.c
@@ -0,0 +1,33 @@
+/*
+ * 16.1.1 Thread Creation Attributes
+ *
+ * COPYRIGHT (c) 1989-2010.
+ * 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$
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#if HAVE_DECL_PTHREAD_ATTR_GETGUARDSIZE
+#include <pthread.h>
+#include <errno.h>
+
+int pthread_attr_getguardsize(
+ const pthread_attr_t *attr,
+ size_t *guardsize
+)
+{
+ if ( !attr || !attr->is_initialized || !guardsize )
+ return EINVAL;
+
+ *guardsize = attr->guardsize;
+ return 0;
+}
+#endif
diff --git a/cpukit/posix/src/pthreadattrgetstack.c b/cpukit/posix/src/pthreadattrgetstack.c
new file mode 100644
index 0000000000..8303099a96
--- /dev/null
+++ b/cpukit/posix/src/pthreadattrgetstack.c
@@ -0,0 +1,35 @@
+/*
+ * 16.1.1 Thread Creation Attributes
+ *
+ * COPYRIGHT (c) 1989-2010.
+ * 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$
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#if HAVE_DECL_PTHREAD_ATTR_GETSTACK
+#include <pthread.h>
+#include <errno.h>
+
+int pthread_attr_getstack(
+ const pthread_attr_t *attr,
+ void **stackaddr,
+ size_t *stacksize
+)
+{
+ if ( !attr || !attr->is_initialized || !stackaddr || !stacksize )
+ return EINVAL;
+
+ *stackaddr = attr->stackaddr;
+ *stacksize = attr->stacksize;
+ return 0;
+}
+#endif
diff --git a/cpukit/posix/src/pthreadattrsetguardsize.c b/cpukit/posix/src/pthreadattrsetguardsize.c
new file mode 100644
index 0000000000..f69ff7b173
--- /dev/null
+++ b/cpukit/posix/src/pthreadattrsetguardsize.c
@@ -0,0 +1,36 @@
+/*
+ * 16.1.1 Thread Creation Attributes
+ *
+ * COPYRIGHT (c) 1989-2010.
+ * 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$
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#if HAVE_DECL_PTHREAD_ATTR_SETGUARDSIZE
+#include <pthread.h>
+#include <errno.h>
+
+#include <rtems/system.h>
+#include <rtems/posix/pthread.h>
+
+int pthread_attr_setguardsize(
+ pthread_attr_t *attr,
+ size_t guardsize
+)
+{
+ if ( !attr || !attr->is_initialized )
+ return EINVAL;
+
+ attr->guardsize = guardsize;
+ return 0;
+}
+#endif
diff --git a/cpukit/posix/src/pthreadattrsetstack.c b/cpukit/posix/src/pthreadattrsetstack.c
new file mode 100644
index 0000000000..f97d3ac885
--- /dev/null
+++ b/cpukit/posix/src/pthreadattrsetstack.c
@@ -0,0 +1,42 @@
+/*
+ * 16.1.1 Thread Creation Attributes
+ *
+ * COPYRIGHT (c) 1989-2010.
+ * 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$
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#if HAVE_DECL_PTHREAD_ATTR_SETSTACK
+#include <pthread.h>
+#include <errno.h>
+
+#include <rtems/system.h>
+#include <rtems/posix/pthread.h>
+
+int pthread_attr_setstack(
+ pthread_attr_t *attr,
+ void *stackaddr,
+ size_t stacksize
+)
+{
+ if ( !attr || !attr->is_initialized )
+ return EINVAL;
+
+ if (stacksize < PTHREAD_MINIMUM_STACK_SIZE)
+ attr->stacksize = PTHREAD_MINIMUM_STACK_SIZE;
+ else
+ attr->stacksize = stacksize;
+
+ attr->stackaddr = stackaddr;
+ return 0;
+}
+#endif