pthread_attr_getdetachstate

Returns the detached state of a thread attribute object.

Library:LibC
Classification:POSIX
Service:Threads

Syntax

  #include <pthread.h>
   
  int   pthread_attr_getdetachstate (
     const pthread_attr_t   *attr,
     int                    *detachstate);
  

Parameters

attr

(IN) Points to the attribute object.

detachstate

(OUT) Points to the detached state value which will be either PTHREAD_CREATE_JOINABLE or PTHREAD_CREATE_DETACHED.

Return Values

If successful, returns zero; otherwise returns a nonzero error code:

Decimal

Constant

Description

9

EINVAL

The attribute object is invalid.

Remarks

The pthread_attr_init function initializes the detached state attribute to PTHREAD_CREATE_JOINABLE.

See Also