Back to index

glibc  2.9
sigaction.c
Go to the documentation of this file.
00001 /* Copyright (C) 1997-2000,2002,2003,2005 Free Software Foundation, Inc.
00002    This file is part of the GNU C Library.
00003    Linux/IA64 specific sigaction
00004    Written by Jes Sorensen, <Jes.Sorensen@cern.ch>, April 1999.
00005 
00006    The GNU C Library is free software; you can redistribute it and/or
00007    modify it under the terms of the GNU Lesser General Public
00008    License as published by the Free Software Foundation; either
00009    version 2.1 of the License, or (at your option) any later version.
00010 
00011    The GNU C Library is distributed in the hope that it will be useful,
00012    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014    Lesser General Public License for more details.
00015 
00016    You should have received a copy of the GNU Lesser General Public
00017    License along with the GNU C Library; if not, write to the Free
00018    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00019    02111-1307 USA.  */
00020 
00021 /* Linux/ia64 only has rt signals, thus we do not even want to try falling
00022    back to the old style signals as the default Linux handler does. */
00023 
00024 #include <errno.h>
00025 #include <signal.h>
00026 #include <string.h>
00027 
00028 #include <sysdep.h>
00029 #include <sys/syscall.h>
00030 #include <bp-checks.h>
00031 
00032 /* The variable is shared between all wrappers around signal handling
00033    functions which have RT equivalents.  This is the definition.  */
00034 
00035 
00036 /* If ACT is not NULL, change the action for SIG to *ACT.
00037    If OACT is not NULL, put the old action for SIG in *OACT.  */
00038 int
00039 __libc_sigaction (sig, act, oact)
00040      int sig;
00041      const struct sigaction *act;
00042      struct sigaction *oact;
00043 {
00044   /* XXX The size argument hopefully will have to be changed to the
00045      real size of the user-level sigset_t.  */
00046   return INLINE_SYSCALL (rt_sigaction, 4, sig,
00047                       CHECK_1_NULL_OK (act), CHECK_1_NULL_OK (oact), _NSIG / 8);
00048 }
00049 libc_hidden_def (__libc_sigaction)
00050 
00051 #ifdef WRAPPER_INCLUDE
00052 # include WRAPPER_INCLUDE
00053 #endif
00054 
00055 #ifndef LIBC_SIGACTION
00056 weak_alias (__libc_sigaction, __sigaction)
00057 libc_hidden_def (__sigaction)
00058 weak_alias (__libc_sigaction, sigaction)
00059 #endif