2018-01-01 00:32:25 +00:00
|
|
|
/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
|
2001-03-03 18:21:04 +00:00
|
|
|
This file is part of the GNU C Library.
|
|
|
|
|
|
|
|
The GNU C Library is free software; you can redistribute it and/or
|
2001-07-06 04:58:11 +00:00
|
|
|
modify it under the terms of the GNU Lesser General Public
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
version 2.1 of the License, or (at your option) any later version.
|
2001-03-03 18:21:04 +00:00
|
|
|
|
|
|
|
The GNU C Library is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
2001-07-06 04:58:11 +00:00
|
|
|
Lesser General Public License for more details.
|
2001-03-03 18:21:04 +00:00
|
|
|
|
2001-07-06 04:58:11 +00:00
|
|
|
You should have received a copy of the GNU Lesser General Public
|
2012-02-09 23:18:22 +00:00
|
|
|
License along with the GNU C Library; if not, see
|
|
|
|
<http://www.gnu.org/licenses/>. */
|
2001-03-03 18:21:04 +00:00
|
|
|
|
|
|
|
#include <errno.h>
|
|
|
|
#include <netdb.h>
|
|
|
|
#include <signal.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
|
|
|
|
#include <sysdep.h>
|
|
|
|
#include <sys/syscall.h>
|
|
|
|
|
|
|
|
#include "gai_misc.h"
|
|
|
|
|
|
|
|
#ifdef __NR_rt_sigqueueinfo
|
|
|
|
|
|
|
|
/* Return any pending signal or wait for one for the given time. */
|
|
|
|
int
|
2015-10-19 12:04:33 +00:00
|
|
|
__gai_sigqueue (int sig, const union sigval val, pid_t caller_pid)
|
2001-03-03 18:21:04 +00:00
|
|
|
{
|
|
|
|
siginfo_t info;
|
|
|
|
|
|
|
|
/* First, clear the siginfo_t structure, so that we don't pass our
|
|
|
|
stack content to other tasks. */
|
|
|
|
memset (&info, 0, sizeof (siginfo_t));
|
|
|
|
/* We must pass the information about the data in a siginfo_t value. */
|
|
|
|
info.si_signo = sig;
|
|
|
|
info.si_code = SI_ASYNCNL;
|
|
|
|
info.si_pid = caller_pid;
|
2001-08-17 07:51:36 +00:00
|
|
|
info.si_uid = __getuid ();
|
2001-03-03 18:21:04 +00:00
|
|
|
info.si_value = val;
|
|
|
|
|
2015-08-21 16:57:15 +00:00
|
|
|
return INLINE_SYSCALL (rt_sigqueueinfo, 3, info.si_pid, sig, &info);
|
2001-03-03 18:21:04 +00:00
|
|
|
}
|
|
|
|
#else
|
2005-12-15 21:13:14 +00:00
|
|
|
# include <resolv/gai_sigqueue.c>
|
2001-03-03 18:21:04 +00:00
|
|
|
#endif
|