提交 8c967b93 编写于 作者: R Rich Felker

enforce stack size min in pthread_attr_setstacksize

上级 6fc5fdbd
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
int pthread_attr_setstacksize(pthread_attr_t *a, size_t size) int pthread_attr_setstacksize(pthread_attr_t *a, size_t size)
{ {
if (size-PAGE_SIZE > SIZE_MAX/4) return EINVAL; if (size-PTHREAD_STACK_MIN > SIZE_MAX/4) return EINVAL;
a->_a_stacksize = size - DEFAULT_STACK_SIZE; a->_a_stacksize = size - DEFAULT_STACK_SIZE;
return 0; return 0;
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册