diff options
Diffstat (limited to 'lib/raise.c')
-rw-r--r-- | lib/raise.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/lib/raise.c b/lib/raise.c new file mode 100644 index 000000000..5a6e0e62d --- /dev/null +++ b/lib/raise.c @@ -0,0 +1,33 @@ +/* Provide a non-threads replacement for the POSIX raise function. + Copyright (C) 2002 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +/* written by Jim Meyering */ + +#include <config.h> + +/* Undefine raise here so any system prototype is not redefined + to be a prototype for rpl_raise. */ +#undef raise + +#include <sys/types.h> +#include <signal.h> + +int +rpl_raise (int sig) +{ + kill (getpid (), sig) +} |