Files
glibc/sysdeps/unix/sysv/linux/sigqueue.c
T

53 lines
1.7 KiB
C
Raw Normal View History

/* Copyright (C) 1997, 1998, 2000, 2003, 2005 Free Software Foundation, Inc.
1997-12-04 00:12:34 +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.
1997-12-04 00:12:34 +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.
1997-12-04 00:12:34 +00:00
2001-07-06 04:58:11 +00:00
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
1997-12-04 00:12:34 +00:00
1998-10-21 15:29:52 +00:00
#include <errno.h>
1997-12-04 00:12:34 +00:00
#include <signal.h>
#include <unistd.h>
2000-01-24 12:09:14 +00:00
#include <string.h>
1997-12-04 00:12:34 +00:00
1998-10-21 15:29:52 +00:00
#include <sysdep.h>
#include <sys/syscall.h>
1998-10-31 11:42:52 +00:00
#ifdef __NR_rt_sigqueueinfo
1997-12-04 00:12:34 +00:00
/* Return any pending signal or wait for one for the given time. */
int
__sigqueue (pid, sig, val)
pid_t pid;
int sig;
const union sigval val;
{
siginfo_t info;
2000-01-24 12:09:14 +00:00
/* First, clear the siginfo_t structure, so that we don't pass our
stack content to other tasks. */
memset (&info, 0, sizeof (siginfo_t));
1997-12-04 00:12:34 +00:00
/* We must pass the information about the data in a siginfo_t value. */
info.si_signo = sig;
info.si_code = SI_QUEUE;
1998-06-29 12:44:22 +00:00
info.si_pid = __getpid ();
1998-06-22 17:08:51 +00:00
info.si_uid = __getuid ();
1997-12-04 00:12:34 +00:00
info.si_value = val;
return INLINE_SYSCALL (rt_sigqueueinfo, 3, pid, sig, __ptrvalue (&info));
1997-12-04 00:12:34 +00:00
}
1998-02-19 18:52:30 +00:00
weak_alias (__sigqueue, sigqueue)
1998-10-31 11:42:52 +00:00
#else
# include <signal/sigqueue.c>
1998-10-31 11:42:52 +00:00
#endif