So... I installed the BeOS Preview Release (available free with MacUser's
October 1997 newsstand issue - $4 isn't bad for an OS) on my Power
Mac. Interesting operating system. Buggy as hell, but interesting. And
for some reason, they don't provide a "clear" command, which annoyed me
more than anything else - I like my shell windows to be uncluttered :)
Anyhow, here's a patch that should make Apache run under BeOS. I say
"should" because I can't test it; while it compiles cleanly, the cc that
Be provides won't do the final step of building any executable larger
than 64k, unless you shell out a few hundred bucks to Metrowerks. I
understand there's a gcc port in the works, but the BeOS linker format is
proprietary, and Be isn't giving out that information. But I'm 80%
confident that with this patch, Apache will work. At least it's a
starting point. So according to dev.apache.org/project-plan, we should be
ready to release 3.0 now, right?
Even so, I must say... Apache compiles faster under BeOS on my PowerBase
180 than on any other machine I can remember using... much faster than
the SPARCstation 5 running Solaris 2.5.1 I usually use.
One note, though: Sometime recently, the #define SCOREBOARD_FILE
dissapeared from http_main.c, making all non-shared memory OSes stop
working (which is why there's a #define SCOREBOARD_FILE in the BeOS
section in the patch below - that's wrong, http_main.c should be fixed,
but I didn't feel like taking the time to go back and do that). I'm going
to sleep now (1:49 am), but someone should fix this.
The patch:
--- Configure.old Wed Aug 27 00:07:15 1997
+++ Configure Wed Aug 27 00:23:41 1997
@@ -480,6 +480,11 @@
MAKE="make"
DEF_WANTHSREGEX=yes
;;
+ *-BeOS*)
+ OS='BeOS';
+ CFLAGS="$CFLAGS -DBEOS"
+ DEF_WANTHSREGEX=yes
+ ;;
*) # default: Catch systems we don't know about
echo Sorry, but we cannot grok \"$PLAT\"
echo uname -m
--- main/conf.h.old Wed Aug 27 00:13:26 1997
+++ main/conf.h Wed Aug 27 01:31:33 1997
@@ -577,6 +577,21 @@
#define NEED_STRNCASECMP
#define NEED_STRDUP
+#elif defined(BEOS)
+#include <stddef.h>
+
+#define JMP_BUF sigjmp_buf
+#define NO_WRITEV
+#define NO_KILLPG
+#define NEED_INITGROUPS
+
+/* BeOS doesn't have a couple signals... redefine to close ones*/
+#define SIGBUS SIGSEGV
+#define SIGURG SIGPIPE
+
+#define isascii(c) (!((c) & ~0177))
+#define SCOREBOARD_FILE
+
#elif defined(WIN32)
/* Put your NT stuff here - Ambarish */
@@ -728,9 +743,9 @@
#include <netinet/in.h>
#include <netdb.h>
#include <sys/ioctl.h>
-#ifndef MPE
+#if !defined(MPE) && !defined(BEOS)
#include <arpa/inet.h> /* for inet_ntoa */
-#endif /* ndef MPE */
+#endif
#include <sys/wait.h>
#include <pwd.h>
#include <grp.h>
--- main/http_main.c.old Wed Aug 27 00:36:40 1997
+++ main/http_main.c Wed Aug 27 01:06:02 1997
@@ -98,7 +98,7 @@
#endif
#ifdef WIN32
#include "../os/win32/getopt.h"
-#else
+#elif !defined(BEOS)
#include <netinet/tcp.h>
#endif
@@ -1946,7 +1946,7 @@
name = ent->pw_name;
} else name = user_name;
-#ifndef __EMX__
+#ifndef __EMX__
/* OS/2 dosen't support groups. */
/* Reset `groups' attributes. */
@@ -2306,11 +2306,14 @@
exit(1);
}
one = 1;
+#ifndef BEOS
+/* BeOS does not support SO_KEEPALIVE */
if (setsockopt(s, SOL_SOCKET,SO_KEEPALIVE,(char *)&one,sizeof(int)) < 0) {
log_unixerr("setsockopt", "(SO_KEEPALIVE)", NULL, server_conf);
exit(1);
}
#endif
+#endif
sock_disable_nagle(s);
sock_enable_linger(s);
@@ -2334,6 +2337,7 @@
*
* If no size is specified, use the kernel default.
*/
+#ifndef BEOS /* BeOS does not support SO_SNDBUF */
if (server_conf->send_buffer_size) {
if (setsockopt(s, SOL_SOCKET, SO_SNDBUF,
(char *)&server_conf->send_buffer_size, sizeof(int)) < 0) {
@@ -2343,6 +2347,7 @@
/* not a fatal error */
}
}
+#endif
#ifdef MPE
/* MPE requires CAP=PM and GETPRIVMODE to bind to ports less than 1024 */
--- main/util.c.old Wed Aug 27 01:12:03 1997
+++ main/util.c Wed Aug 27 01:10:59 1997
@@ -1079,8 +1079,8 @@
#ifdef NEED_INITGROUPS
int initgroups(const char *name, gid_t basegid)
{
-#if defined(QNX) || defined(MPE)
-/* QNX and MPE do not appear to support supplementary groups. */
+#if defined(QNX) || defined(MPE) || defined(BEOS)
+/* QNX, MPE and BeOS do not appear to support supplementary groups. */
return 0;
#else /* ndef QNX */
gid_t groups[NGROUPS_MAX];
-- Alexei Kosut <akosut@organic.com>
|