thr_attr_setstacksize.c (17706) | thr_attr_setstacksize.c (22315) |
---|---|
1/* 2 * Copyright (c) 1996 John Birrell <jb@cimlogic.com.au>. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 24 unchanged lines hidden (view full) --- 33#include <errno.h> 34#ifdef _THREAD_SAFE 35#include <pthread.h> 36#include "pthread_private.h" 37 38int pthread_attr_setstacksize(pthread_attr_t *attr, size_t stacksize) 39{ 40 int ret; | 1/* 2 * Copyright (c) 1996 John Birrell <jb@cimlogic.com.au>. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 24 unchanged lines hidden (view full) --- 33#include <errno.h> 34#ifdef _THREAD_SAFE 35#include <pthread.h> 36#include "pthread_private.h" 37 38int pthread_attr_setstacksize(pthread_attr_t *attr, size_t stacksize) 39{ 40 int ret; |
41 if (attr == NULL || *attr == NULL || stacksize < PTHREAD_STACK_MIN) { 42 errno = EINVAL; 43 ret = -1; 44 } else { | 41 42 /* Check for invalid arguments: */ 43 if (attr == NULL || *attr == NULL || stacksize < PTHREAD_STACK_MIN) 44 ret = EINVAL; 45 else { 46 /* Save the stack size: */ |
45 (*attr)->stacksize_attr = stacksize; 46 ret = 0; 47 } 48 return(ret); 49} 50#endif | 47 (*attr)->stacksize_attr = stacksize; 48 ret = 0; 49 } 50 return(ret); 51} 52#endif |