Back to index

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