mailing list of musl libc
 help / color / mirror / code / Atom feed
21cd0f336a7ceb2dc78bd815fb0a8298cbee0cac blob 817 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
 
#include "pthread_impl.h"

extern size_t __default_stacksize;
extern size_t __default_guardsize;

int pthread_setattr_default_np(const pthread_attr_t *attrp)
{
	if (attrp->_a_stackaddr || attrp->_a_detach ||
	    attrp->_a_sched || attrp->_a_policy || attrp->_a_prio)
		return EINVAL;

	__inhibit_ptc();
	if (DEFAULT_STACK_SIZE+attrp->_a_stacksize >= DEFAULT_STACK_SIZE+__default_stacksize)
		__default_stacksize = attrp->_a_stacksize;
	if (DEFAULT_GUARD_SIZE+attrp->_a_guardsize >= DEFAULT_GUARD_SIZE+__default_guardsize)
		__default_guardsize = attrp->_a_guardsize;
	__release_ptc();

	return 0;
}

int pthread_getattr_default_np(pthread_attr_t *attrp)
{
	__acquire_ptc();
	*attrp = (pthread_attr_t) {
		._a_stacksize = __default_stacksize,
		._a_guardsize = __default_guardsize,
	};
	__release_ptc();
	return 0;
}
debug log:

solving 21cd0f3 ...
found 21cd0f3 in https://inbox.vuxu.org/musl/20161031172658.970-1-timo.teras@iki.fi/

applying [1/1] https://inbox.vuxu.org/musl/20161031172658.970-1-timo.teras@iki.fi/
diff --git a/src/thread/pthread_setattr_default_np.c b/src/thread/pthread_setattr_default_np.c
new file mode 100644
index 0000000..21cd0f3

Checking patch src/thread/pthread_setattr_default_np.c...
Applied patch src/thread/pthread_setattr_default_np.c cleanly.

index at:
100644 21cd0f336a7ceb2dc78bd815fb0a8298cbee0cac	src/thread/pthread_setattr_default_np.c

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).