Back to index

glibc  2.9
gai_cancel.c File Reference
#include <netdb.h>
#include <pthread.h>
#include <gai_misc.h>

Go to the source code of this file.


int gai_cancel (struct gaicb *gaicbp)

Function Documentation

int gai_cancel ( struct gaicb *  gaicbp)

Definition at line 27 of file gai_cancel.c.

  int result = 0;
  int status;

  /* Request the mutex.  */
  pthread_mutex_lock (&__gai_requests_mutex);

  /* Find the request among those queued but not yet running.  */
  status = __gai_remove_request (gaicbp);
  if (status == 0)
    result = EAI_CANCELED;
  else if (status > 0)
    result = EAI_NOTCANCELED;
    result = EAI_ALLDONE;

  /* Release the mutex.  */
  pthread_mutex_unlock (&__gai_requests_mutex);

  return result;

Here is the call graph for this function: