14.5. Pthread Attribute Functions

14.5.1. The pthread_attr_destroy function

Synopsis
#include <pthread.h>

int pthread_attr_destroy (pthread_attr_t * attr );

Description

The pthread_attr_destroy function destroys the given thread attribute object.

Returns

The pthread_attr_destroy function returns 0.

Implementation Notes

None.

14.5.2. The pthread_attr_getdetachstate function

Synopsis
#include <pthread.h>

int pthread_attr_getdetachstate (pthread_attr_t * attr , int * detachstate );

Description

The pthread_attr_getdetachstate function gets the value of the detachstate attribute from attr object.

Returns

The pthread_attr_getdetachstate function returns zero if successful and -1 otherwise.

Implementation Notes

None.

14.5.3. The pthread_attr_getinheritsched function

Synopsis
#include <pthread.h>

int pthread_attr_getinheritsched (pthread_attr_t * attr , int * inherit );

Description

The pthread_attr_getinheritsched function gets the value of the inheritsched attribute.

Returns

The pthread_attr_getinheritsched function returns zero if successful and -1 otherwise.

Implementation Notes

None.

14.5.4. The pthread_attr_getschedparam function

Synopsis
#include <pthread.h>

int pthread_attr_getschedparam (pthread_attr_t * attr , struct sched_param * param );

Description

The pthread_attr_getschedparam function gets the value of the scheduling parameter attribute.

Returns

The pthread_attr_getschedparam function returns zero if successful and -1 otherwise.

Implementation Notes

14.5.5. The pthread_attr_getschedpolicy function

Synopsis
#include <pthread.h>

int pthread_attr_getschedpolicy (pthread_attr_t * attr , int * policy );

Description

The pthread_attr_getschedpolicy function gets the policy for the given attribute.

Returns

The pthread_attr_getschedpolicy function returns zero if the given attribute is valid and -1 otherwise.

Implementation Notes

None.

14.5.6. The pthread_attr_init function

Synopsis
#include <pthread.h>

int pthread_attr_init (pthread_attr_t * attr );

Description

The pthread_attr_init function initializes a thread attribute object with default values.

Returns

The pthread_attr_init function returns zero if the call is successful, otherwise it sets errno to EINVAL and returns -1.

Implementation Notes

14.5.7. The pthread_attr_setdetachstate function

Synopsis
#include <pthread.h>

int pthread_attr_setdetachstate (pthread_attr_t * attr , int detachstate );

Description

The pthread_attr_setdetachstate function sets the detachstate attribute in referenced attr object.

Returns

The pthread_attr_setdetachstate function returns zero if the call is successful, otherwise it sets errno to EINVAL and returns -1.

Implementation Notes

None.

14.5.8. The pthread_attr_setinheritsched function

Synopsis
#include <pthread.h>

int pthread_attr_setinheritsched (pthread_attr_t * attr , int inherit );

Description

The pthread_attr_setinheritsched function sets the inheritsched attribute in the referenced attr object.

Returns

The pthread_attr_setinheritsched function returns zero if the call is successful, otherwise it sets errno to EINVAL and returns -1.

Implementation Notes

None.

14.5.9. The pthread_attr_setschedparam function

Synopsis
#include <pthread.h>

int pthread_attr_setschedparam (pthread_attr_t * attr , struct sched_param * param );

Description

The pthread_attr_setschedparam function sets the priority in the referenced attr object.

Returns

The pthread_attr_setschedparam function returns zero if the call is successful, otherwise it sets errno to EINVAL and returns -1.

Implementation Notes

None.

14.5.10. The pthread_attr_setschedpolicy function

Synopsis
#include <pthread.h>

int pthread_attr_setschedpolicy (pthread_attr_t * attr , int policy );

Description

The pthread_attr_setschedpolicy function sets the scheduling policy.

Returns

The pthread_attr_setschedpolicy function returns zero if the call is successful, otherwise it sets errno to EINVAL and returns -1.

Implementation Notes

14.5.11. The pthread_attr_setstacksize function

Synopsis
#include <pthread.h>

int pthread_attr_setstacksize (pthread_attr_t * attr , size_t stacksize );

Description

The pthread_attr_setstacksize function sets the stack size value on the given attribute.

Returns

The pthread_attr_setstacksize function returns zero if the call is successful, otherwise it sets errno to EINVAL and returns -1.

Implementation Notes

None.