Email List: Xaustin-review-lX
[All Lists]

Defect in XSH pthread_attr_getguardsize

To: yyyyyyyyyyyyyyy@xxxxxxxxxxxxx
Subject: Defect in XSH pthread_attr_getguardsize
From: yyyyyyyy@xxxxxxx
Date: Mon, 21 Jul 2003 17:10:16 +0100 (BST)
        Defect report from : Loic Domaigne , personal interest

(Please direct followup comments direct to yyyyyyyyyyyyyy@xxxxxxxxxxxxx)

@ page 0 line 0 section pthread_attr_getguardsize comment 
{pthread_attr_getguardsize}

Problem:

Edition of Specification (Year): 2003

Defect code :  2. Omission

Missing example.

Action:

The following function prints on stdio the size of the guard area for 
the thread attribute referred by ptr_attr. This function illustrates 
the use of pthread_attr_getguardsize(). 


#include <pthread.h>
#include <stdio.h>

void 
print_guardsize(const pthread_attr_t* ptr_attr
                )
{
  int     rc;          /* returned code */
  size_t  guardsize;   /* guard size    */

  printf("\nGuard size (ptr_attr=%p): ", ptr_attr);

  rc = pthread_attr_getguardsize (ptr_attr, &guardsize);

  if (rc != 0)  /* handle error */ 
  {             
    printf ("failed to get guardsize <error %d>\n", rc);
  }
  else          /* print guard size */
  {                 
    if (guardsize > 0) 
    {
      printf ("%zd\n", guardsize);
    }
    else 
    {
      printf ("no guard area provided\n");
    }
  }
}

<Prev in Thread] Current Thread [Next in Thread>