summaryrefslogtreecommitdiff
path: root/lib/raise.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2002-11-10 09:44:05 +0000
committerJim Meyering <jim@meyering.net>2002-11-10 09:44:05 +0000
commitbd03362ebb4f4ba444e4af89140cec350b7eff60 (patch)
treeae358654bb1081715eadfc737efb097dfe86b514 /lib/raise.c
parentb52870d14fcd7c325fd872a2cd60b03a35cdbfc8 (diff)
downloadcoreutils-bd03362ebb4f4ba444e4af89140cec350b7eff60.tar.xz
*** empty log message ***
Diffstat (limited to 'lib/raise.c')
-rw-r--r--lib/raise.c33
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)
+}