diff --git a/lib/ChangeLog b/lib/ChangeLog index af76690c4..5ea90eb0b 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,7 @@ +2002-11-10 Jim Meyering + + * raise.c: New file. + 2002-11-08 Paul Eggert * human.c (human_readable): Revamp to avoid warning about unused 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 + +/* Undefine raise here so any system prototype is not redefined + to be a prototype for rpl_raise. */ +#undef raise + +#include +#include + +int +rpl_raise (int sig) +{ + kill (getpid (), sig) +}