summaryrefslogtreecommitdiff
path: root/ngircd/src/portab/waitpid.c
diff options
context:
space:
mode:
authorMistivia <i@mistivia.com>2025-10-23 23:44:03 +0800
committerMistivia <i@mistivia.com>2025-10-23 23:44:07 +0800
commitc8aeef18cb46a617b6397b9822263895e97e9048 (patch)
treeebe127e7c194039f315b74a5998b05a271c57b9d /ngircd/src/portab/waitpid.c
add ircd
Diffstat (limited to 'ngircd/src/portab/waitpid.c')
-rw-r--r--ngircd/src/portab/waitpid.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/ngircd/src/portab/waitpid.c b/ngircd/src/portab/waitpid.c
new file mode 100644
index 0000000..921dd3d
--- /dev/null
+++ b/ngircd/src/portab/waitpid.c
@@ -0,0 +1,30 @@
+/*
+ * ngIRCd -- The Next Generation IRC Daemon
+ */
+
+#include "portab.h"
+
+/**
+ * @file
+ * waitpid() implementation. Public domain.
+ * Written by Steven D. Blackford for the NeXT system.
+ */
+
+#ifndef HAVE_WAITPID
+
+#include <string.h>
+#include <stdlib.h>
+#include <sys/types.h>
+
+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