Change 13624 by jhi@alpha on 2001/12/11 15:27:06

        The BeOS waitpid() seems to be broken,
        have a wrapper for it.

Affected files ...

.... //depot/perl/MANIFEST#661 edit
.... //depot/perl/beos/beos.c#1 add
.... //depot/perl/beos/beosish.h#1 add
.... //depot/perl/hints/beos.sh#8 edit
.... //depot/perl/perl.h#421 edit

Differences ...

==== //depot/perl/MANIFEST#661 (text) ====
Index: perl/MANIFEST
--- perl/MANIFEST.~1~   Tue Dec 11 08:30:05 2001
+++ perl/MANIFEST       Tue Dec 11 08:30:05 2001
@@ -3,6 +3,8 @@
 AUTHORS                        Contact info for contributors
 av.c                   Array value code
 av.h                   Array value header
+beos/beosish.h         BeOS port
+beos/beos.c            BeOS port
 beos/nm.c              BeOS port
 bytecode.pl            Produces ext/ByteLoader/byterun.h, ext/ByteLoader/byterun.c 
and ext/B/Asmdata.pm
 cc_runtime.h           Macros need by runtime of compiler-generated code

==== //depot/perl/hints/beos.sh#8 (text) ====
Index: perl/hints/beos.sh
--- perl/hints/beos.sh.~1~      Tue Dec 11 08:30:05 2001
+++ perl/hints/beos.sh  Tue Dec 11 08:30:05 2001
@@ -55,3 +55,5 @@
 '') ldlibpthname=LIBRARY_PATH ;;
 esac
 
+# the waitpid() wrapper
+archobjs="beos/beos.o"

==== //depot/perl/perl.h#421 (text) ====
Index: perl/perl.h
--- perl/perl.h.~1~     Tue Dec 11 08:30:05 2001
+++ perl/perl.h Tue Dec 11 08:30:05 2001
@@ -1800,6 +1800,11 @@
 #   define ISHISH "macos classic"
 #endif
 
+#if defined(__BEOS__)
+#   include "beos/beosish.h"
+#   define ISHISH "beos"
+#endif
+
 #ifndef ISHISH
 #   include "unixish.h"
 #   define ISHISH "unix"

==== //depot/perl/beos/beos.c#1 (text) ====
Index: perl/beos/beos.c
--- perl/beos/beos.c.~1~        Tue Dec 11 08:30:05 2001
+++ perl/beos/beos.c    Tue Dec 11 08:30:05 2001
@@ -0,0 +1,16 @@
+#undef waitpid
+
+#include <sys/wait.h>
+
+/* In BeOS 5.0 the waitpid() seems to misbehave in that the status
+ * is _not_ shifted left by eight (multiplied by 256), as it is in
+ * POSIX/UNIX.  To undo the surpise effect to the rest of Perl we
+ * need this wrapper.  (The rest of BeOS might be surprised because
+ * of this, though.) */
+
+pid_t beos_waitpid(pid_t process_id, int *status_location, int options) {
+    pid_t got = waitpid(procedd_is, status_location, options);
+    if (status_localtion)
+        *status_location <<= 8;
+    return got;
+}

==== //depot/perl/beos/beosish.h#1 (text) ====
Index: perl/beos/beosish.h
--- perl/beos/beosish.h.~1~     Tue Dec 11 08:30:05 2001
+++ perl/beos/beosish.h Tue Dec 11 08:30:05 2001
@@ -0,0 +1,13 @@
+#ifndef PERL_BEOS_BEOSISH_H
+#define PERL_BEOS_BEOSISH_H
+
+#include "unixish.h"
+
+#undef  waitpid
+#define waitpid beos_waitpid
+
+/* This seems to be protoless. */
+char *gcvt(double value, int num_digits, char *buffer);
+
+#endif
+
End of Patch.

Reply via email to