about summary refs log tree commit diff
path: root/src/portab/waitpid.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/portab/waitpid.c')
-rw-r--r--src/portab/waitpid.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/portab/waitpid.c b/src/portab/waitpid.c
new file mode 100644
index 00000000..0c169601
--- /dev/null
+++ b/src/portab/waitpid.c
@@ -0,0 +1,31 @@
+/*
+ * ngIRCd -- The Next Generation IRC Daemon
+ *
+ * waitpid() implementation. Public domain.
+ * Written by Steven D. Blackford for the NeXT system.
+ *
+ */
+
+#include "portab.h"
+
+#include "imp.h"
+#include <string.h>
+#include <stdlib.h>
+#include <sys/types.h>
+
+#include "exp.h"
+
+#ifndef HAVE_WAITPID
+
+GLOBAL int
+waitpid(pid, stat_loc, options)
+int pid, *stat_loc, options;
+{
+	for (;;) {
+		int wpid = wait(stat_loc);
+		if (wpid == pid || wpid == -1)
+			return wpid;
+	}
+}
+
+#endif