]> git.ipfire.org Git - thirdparty/glibc.git/blame - sysdeps/unix/sysv/linux/aio_sigqueue.c
powerpc: Remove unintended __longjmp symbol from ABI
[thirdparty/glibc.git] / sysdeps / unix / sysv / linux / aio_sigqueue.c
CommitLineData
f7a9f785 1/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
cbdee279
UD
2 This file is part of the GNU C Library.
3
4 The GNU C Library is free software; you can redistribute it and/or
41bdb6e2
AJ
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
cbdee279
UD
8
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
41bdb6e2 12 Lesser General Public License for more details.
cbdee279 13
41bdb6e2 14 You should have received a copy of the GNU Lesser General Public
59ba27a6
PE
15 License along with the GNU C Library; if not, see
16 <http://www.gnu.org/licenses/>. */
cbdee279
UD
17
18#include <aio.h>
0dee6738 19#include <errno.h>
cbdee279
UD
20#include <signal.h>
21#include <unistd.h>
e645ed3a 22#include <string.h>
cbdee279 23
0dee6738
UD
24#include <sysdep.h>
25#include <sys/syscall.h>
26
8f480b4b 27#include <aio_misc.h>
cbdee279 28
655b26bb 29#ifdef __NR_rt_sigqueueinfo
cbdee279
UD
30
31/* Return any pending signal or wait for one for the given time. */
32int
bd2260a2
JM
33internal_function
34__aio_sigqueue (int sig, const union sigval val, pid_t caller_pid)
cbdee279
UD
35{
36 siginfo_t info;
37
e645ed3a
UD
38 /* First, clear the siginfo_t structure, so that we don't pass our
39 stack content to other tasks. */
40 memset (&info, 0, sizeof (siginfo_t));
cbdee279
UD
41 /* We must pass the information about the data in a siginfo_t value. */
42 info.si_signo = sig;
cbdee279 43 info.si_code = SI_ASYNCIO;
3a9eb648 44 info.si_pid = caller_pid;
a53bad16 45 info.si_uid = getuid ();
cbdee279
UD
46 info.si_value = val;
47
e5dee2c8 48 return INLINE_SYSCALL (rt_sigqueueinfo, 3, info.si_pid, sig, &info);
cbdee279 49}
655b26bb 50#else
2826ac7e 51# include <rt/aio_sigqueue.c>
655b26bb 52#endif