forked from Imagelibrary/rtems
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.
This commit is contained in:
@@ -1,3 +1,10 @@
|
||||
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.
|
||||
|
||||
2010-09-28 Sebastian Huber <sebastian.huber@embedded-brains.de>
|
||||
|
||||
* posix/src/psignal.c: Fixed NULL pointer access.
|
||||
|
||||
@@ -15,6 +15,7 @@ SUBDIRS += libi2c
|
||||
SUBDIRS += libmisc
|
||||
SUBDIRS += libmd
|
||||
SUBDIRS += libgnat
|
||||
SUBDIRS += libdbm
|
||||
SUBDIRS += wrapup
|
||||
|
||||
SUBDIRS += zlib
|
||||
|
||||
@@ -351,6 +351,7 @@ libcsupport/Makefile
|
||||
libnetworking/Makefile
|
||||
librpc/Makefile
|
||||
libmisc/Makefile
|
||||
libdbm/Makefile
|
||||
libi2c/Makefile
|
||||
libmd/Makefile
|
||||
zlib/Makefile
|
||||
|
||||
@@ -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 \
|
||||
|
||||
@@ -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
|
||||
|
||||
33
cpukit/posix/src/pthreadattrgetguardsize.c
Normal file
33
cpukit/posix/src/pthreadattrgetguardsize.c
Normal file
@@ -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
|
||||
35
cpukit/posix/src/pthreadattrgetstack.c
Normal file
35
cpukit/posix/src/pthreadattrgetstack.c
Normal file
@@ -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
|
||||
36
cpukit/posix/src/pthreadattrsetguardsize.c
Normal file
36
cpukit/posix/src/pthreadattrsetguardsize.c
Normal file
@@ -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
|
||||
42
cpukit/posix/src/pthreadattrsetstack.c
Normal file
42
cpukit/posix/src/pthreadattrsetstack.c
Normal file
@@ -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
|
||||
Reference in New Issue
Block a user