Blame resolv/gai_misc.h

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