by Steven D. Blackford <kb7sqi@aol.com>:
"I wanted to let you know that I've done a quick port of ngircd-0.12.0 for
NEXTSTEP3.3/OPENSTEP4.2. There wasn't a lot of changes required to get it
to compile clean, but I did make the necessary changes so that I didn't
have to use -posix flag. The NeXT has a pretty buggy POSIX implementation
so I always try to work around it. :-)
Anway, here's the changes required to get it to compile."
}
/* New child process */
+#ifndef NeXT
(void)setsid( );
+#else
+ setpgrp(0, getpid());
+#endif
chdir( "/" );
/* Detach stdin, stdout and stderr */
noinst_LIBRARIES = libngportab.a
-libngportab_a_SOURCES = strdup.c strlcpy.c strtok_r.c vsnprintf.c
+libngportab_a_SOURCES = strdup.c strlcpy.c strtok_r.c vsnprintf.c waitpid.c
check_PROGRAMS = portabtest
#endif
#endif
+#ifdef NeXT
+#define S_IRUSR 0000400 /* read permission, owner */
+#define S_IWUSR 0000200 /* write permission, owner */
+#define S_IRGRP 0000040 /* read permission, group */
+#define S_IROTH 0000004 /* read permission, other */
+#define ssize_t int
+#endif
+
#undef GLOBAL
#define GLOBAL
--- /dev/null
+/*
+ * 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