source: asp3_tinet_ecnl_arm/trunk/musl-1.1.18/src/thread/pthread_setattr_default_np.c@ 352

Last change on this file since 352 was 352, checked in by coas-nagasima, 6 years ago

arm向けASP3版ECNLを追加

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/x-csrc;charset=UTF-8
File size: 852 bytes
Line 
1#include "pthread_impl.h"
2#include <string.h>
3
4extern size_t __default_stacksize;
5extern size_t __default_guardsize;
6
7int pthread_setattr_default_np(const pthread_attr_t *attrp)
8{
9 /* Reject anything in the attr object other than stack/guard size. */
10 pthread_attr_t tmp = *attrp, zero = { 0 };
11 tmp._a_stacksize = 0;
12 tmp._a_guardsize = 0;
13 if (memcmp(&tmp, &zero, sizeof tmp))
14 return EINVAL;
15
16 __inhibit_ptc();
17 if (attrp->_a_stacksize >= __default_stacksize)
18 __default_stacksize = attrp->_a_stacksize;
19 if (attrp->_a_guardsize >= __default_guardsize)
20 __default_guardsize = attrp->_a_guardsize;
21 __release_ptc();
22
23 return 0;
24}
25
26int pthread_getattr_default_np(pthread_attr_t *attrp)
27{
28 __acquire_ptc();
29 *attrp = (pthread_attr_t) {
30 ._a_stacksize = __default_stacksize,
31 ._a_guardsize = __default_guardsize,
32 };
33 __release_ptc();
34 return 0;
35}
Note: See TracBrowser for help on using the repository browser.