Blame resolv/gai_misc.h

Packit Service 82fcde
/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
Packit Service 82fcde
   This file is part of the GNU C Library.
Packit Service 82fcde
   Contributed by Ulrich Drepper <drepper@redhat.com>, 2001.
Packit Service 82fcde
Packit Service 82fcde
   The GNU C Library is free software; you can redistribute it and/or
Packit Service 82fcde
   modify it under the terms of the GNU Lesser General Public
Packit Service 82fcde
   License as published by the Free Software Foundation; either
Packit Service 82fcde
   version 2.1 of the License, or (at your option) any later version.
Packit Service 82fcde
Packit Service 82fcde
   The GNU C Library is distributed in the hope that it will be useful,
Packit Service 82fcde
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service 82fcde
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit Service 82fcde
   Lesser General Public License for more details.
Packit Service 82fcde
Packit Service 82fcde
   You should have received a copy of the GNU Lesser General Public
Packit Service 82fcde
   License along with the GNU C Library; if not, see
Packit Service 82fcde
   <http://www.gnu.org/licenses/>.  */
Packit Service 82fcde
Packit Service 82fcde
#ifndef _GAI_MISC_H
Packit Service 82fcde
#define _GAI_MISC_H	1
Packit Service 82fcde
Packit Service 82fcde
#include <netdb.h>
Packit Service 82fcde
#include <signal.h>
Packit Service 82fcde
Packit Service 82fcde
Packit Service 82fcde
/* Used to synchronize.  */
Packit Service 82fcde
struct waitlist
Packit Service 82fcde
  {
Packit Service 82fcde
    struct waitlist *next;
Packit Service 82fcde
Packit Service 82fcde
#ifndef DONT_NEED_GAI_MISC_COND
Packit Service 82fcde
    pthread_cond_t *cond;
Packit Service 82fcde
#endif
Packit Service 82fcde
    volatile unsigned int *counterp;
Packit Service 82fcde
    /* The next field is used in asynchronous `lio_listio' operations.  */
Packit Service 82fcde
    struct sigevent *sigevp;
Packit Service 82fcde
    /* XXX See requestlist, it's used to work around the broken signal
Packit Service 82fcde
       handling in Linux.  */
Packit Service 82fcde
    pid_t caller_pid;
Packit Service 82fcde
  };
Packit Service 82fcde
Packit Service 82fcde
Packit Service 82fcde
/* Used to queue requests..  */
Packit Service 82fcde
struct requestlist
Packit Service 82fcde
  {
Packit Service 82fcde
    int running;
Packit Service 82fcde
Packit Service 82fcde
    struct requestlist *next;
Packit Service 82fcde
Packit Service 82fcde
    /* Pointer to the actual data.  */
Packit Service 82fcde
    struct gaicb *gaicbp;
Packit Service 82fcde
Packit Service 82fcde
    /* List of waiting processes.  */
Packit Service 82fcde
    struct waitlist *waiting;
Packit Service 82fcde
  };
Packit Service 82fcde
Packit Service 82fcde
/* To customize the implementation one can use the following struct.
Packit Service 82fcde
   This implementation follows the one in Irix.  */
Packit Service 82fcde
struct gaiinit
Packit Service 82fcde
  {
Packit Service 82fcde
    int gai_threads;		/* Maximal number of threads.  */
Packit Service 82fcde
    int gai_num;		/* Number of expected simultanious requests. */
Packit Service 82fcde
    int gai_locks;		/* Not used.  */
Packit Service 82fcde
    int gai_usedba;		/* Not used.  */
Packit Service 82fcde
    int gai_debug;		/* Not used.  */
Packit Service 82fcde
    int gai_numusers;		/* Not used.  */
Packit Service 82fcde
    int gai_idle_time;		/* Number of seconds before idle thread
Packit Service 82fcde
				   terminates.  */
Packit Service 82fcde
    int gai_reserved;
Packit Service 82fcde
  };
Packit Service 82fcde
Packit Service 82fcde
Packit Service 82fcde
/* Lock for global I/O list of requests.  */
Packit Service 82fcde
extern pthread_mutex_t __gai_requests_mutex;
Packit Service 82fcde
Packit Service 82fcde
Packit Service 82fcde
/* Enqueue request.  */
Packit Service 82fcde
extern struct requestlist *__gai_enqueue_request (struct gaicb *gaicbp)
Packit Service 82fcde
     attribute_hidden;
Packit Service 82fcde
Packit Service 82fcde
/* Find request on wait list.  */
Packit Service 82fcde
extern struct requestlist *__gai_find_request (const struct gaicb *gaicbp)
Packit Service 82fcde
     attribute_hidden;
Packit Service 82fcde
Packit Service 82fcde
/* Remove request from waitlist.  */
Packit Service 82fcde
extern int __gai_remove_request (struct gaicb *gaicbp)
Packit Service 82fcde
     attribute_hidden;
Packit Service 82fcde
Packit Service 82fcde
/* Notify initiator of request and tell this everybody listening.  */
Packit Service 82fcde
extern void __gai_notify (struct requestlist *req)
Packit Service 82fcde
     attribute_hidden;
Packit Service 82fcde
Packit Service 82fcde
/* Notify initiator of request.  */
Packit Service 82fcde
extern int __gai_notify_only (struct sigevent *sigev, pid_t caller_pid)
Packit Service 82fcde
     attribute_hidden;
Packit Service 82fcde
Packit Service 82fcde
/* Send the signal.  */
Packit Service 82fcde
extern int __gai_sigqueue (int sig, const union sigval val, pid_t caller_pid);
Packit Service 82fcde
Packit Service 82fcde
#endif /* gai_misc.h */